Skip to content

Commit

Permalink
feat(serenity-js): upgraded Serenity/JS to 3.3.0 (#271)
Browse files Browse the repository at this point in the history
* feat(serenity-js): upgraded to Serenity/JS 3.3.0, dropped support for Node 14

Node 14 has reached its end-of-life; in this release we're dropping support for Node 14 and
introducing support for Node 20

closes #268

* style(eslint): upgraded ESLint and applied the recommended conventions
  • Loading branch information
jan-molak committed Jun 5, 2023
1 parent f59cef0 commit 7ed808f
Show file tree
Hide file tree
Showing 39 changed files with 4,298 additions and 980 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down
48 changes: 25 additions & 23 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { serenity } = require('@serenity-js/core');
const { Path } = require('@serenity-js/core/lib/io');
const {serenity} = require('@serenity-js/core');
const {Path} = require('@serenity-js/core/lib/io');
const {
ProtractorFrameworkAdapter,
TestRunnerDetector,
TestRunnerLoader
ProtractorFrameworkAdapter,
TestRunnerDetector,
TestRunnerLoader,
} = require('@serenity-js/protractor/lib/adapter');

/**
Expand All @@ -14,25 +14,27 @@ const {
* @return {Promise<void>>} Promise resolved with the test results
*/
exports.run = function (runner, specs) {
return new ProtractorFrameworkAdapter(
serenity,
runner,
new TestRunnerDetector(new TestRunnerLoader(
testModeOrDefaultCwd(runner.getConfig().configDir),
process.pid
))
).run(specs);
}
return new ProtractorFrameworkAdapter(
serenity,
runner,
new TestRunnerDetector(
new TestRunnerLoader(
testModeOrDefaultCwd(runner.getConfig().configDir),
process.pid
)
)
).run(specs);
};

function testModeOrDefaultCwd(defaulValue) {
if (! process.env.MULTIDEP_CUCUMBER_CONF) {
return Path.from(defaulValue);
}
if (!process.env.MULTIDEP_CUCUMBER_CONF) {
return Path.from(defaulValue);
}

// protractor-framework-adapter running in self-test mode
const cucumberConf = JSON.parse(process.env.MULTIDEP_CUCUMBER_CONF);
return Path.from(
__dirname,
`test/multidep_modules/${ cucumberConf.module }-${ cucumberConf.version }`
);
// protractor-framework-adapter running in self-test mode
const cucumberConf = JSON.parse(process.env.MULTIDEP_CUCUMBER_CONF);
return Path.from(
__dirname,
`test/multidep_modules/${cucumberConf.module}-${cucumberConf.version}`
);
}
Loading

0 comments on commit 7ed808f

Please sign in to comment.