@cucumber/cucumber
Advanced tools
Comparing version 8.9.1 to 8.10.0
@@ -8,3 +8,6 @@ "use strict"; | ||
const string_argv_1 = __importDefault(require("string-argv")); | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const yaml_1 = __importDefault(require("yaml")); | ||
const util_1 = require("util"); | ||
const url_1 = require("url"); | ||
@@ -37,15 +40,26 @@ const merge_configurations_1 = require("./merge_configurations"); | ||
const filePath = path_1.default.join(cwd, file); | ||
const extension = path_1.default.extname(filePath); | ||
let definitions; | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
definitions = require(filePath); | ||
switch (extension) { | ||
case '.json': | ||
definitions = JSON.parse(await (0, util_1.promisify)(fs_1.default.readFile)(filePath, { encoding: 'utf-8' })); | ||
break; | ||
case '.yaml': | ||
case '.yml': | ||
definitions = yaml_1.default.parse(await (0, util_1.promisify)(fs_1.default.readFile)(filePath, { encoding: 'utf-8' })); | ||
break; | ||
default: | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
definitions = require(filePath); | ||
} | ||
catch (error) { | ||
if (error.code === 'ERR_REQUIRE_ESM') { | ||
definitions = await importer((0, url_1.pathToFileURL)(filePath)); | ||
} | ||
else { | ||
throw error; | ||
} | ||
} | ||
} | ||
catch (error) { | ||
if (error.code === 'ERR_REQUIRE_ESM') { | ||
definitions = await importer((0, url_1.pathToFileURL)(filePath)); | ||
} | ||
else { | ||
throw error; | ||
} | ||
} | ||
if (typeof definitions !== 'object') { | ||
@@ -52,0 +66,0 @@ throw new Error(`Configuration file ${filePath} does not export an object`); |
@@ -14,2 +14,4 @@ "use strict"; | ||
'cucumber.json', | ||
'cucumber.yaml', | ||
'cucumber.yml', | ||
]; | ||
@@ -16,0 +18,0 @@ function locateFile(cwd) { |
@@ -25,10 +25,7 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatSummary = void 0; | ||
const duration_1 = __importDefault(require("duration")); | ||
const messages = __importStar(require("@cucumber/messages")); | ||
const value_checker_1 = require("../../value_checker"); | ||
const luxon_1 = require("luxon"); | ||
const STATUS_REPORT_ORDER = [ | ||
@@ -93,6 +90,9 @@ messages.TestStepResultStatus.FAILED, | ||
const end = new Date(messages.TimeConversion.durationToMilliseconds(durationMsg)); | ||
const duration = new duration_1.default(start, end); | ||
// Use spaces in toString method for readability and to avoid %Ls which is a format | ||
return duration.toString('%Ms m %S . %L s').replace(/ /g, ''); | ||
const duration = luxon_1.Interval.fromDateTimes(start, end).toDuration([ | ||
'minutes', | ||
'seconds', | ||
'milliseconds', | ||
]); | ||
return duration.toFormat("m'm'ss.SSS's'"); | ||
} | ||
//# sourceMappingURL=summary_helpers.js.map |
@@ -1,1 +0,1 @@ | ||
export declare const version = "8.9.1"; | ||
export declare const version = "8.10.0"; |
@@ -5,3 +5,3 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = '8.9.1'; | ||
exports.version = '8.10.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "8.9.1", | ||
"version": "8.10.0", | ||
"homepage": "https://github.com/cucumber/cucumber-js", | ||
@@ -215,3 +215,2 @@ "author": "Julien Biezemans <jb@jbpros.com>", | ||
"debug": "^4.3.4", | ||
"duration": "^0.2.2", | ||
"durations": "^3.4.2", | ||
@@ -228,2 +227,3 @@ "error-stack-parser": "^2.1.4", | ||
"lodash.mergewith": "^4.6.2", | ||
"luxon": "^3.1.1", | ||
"mz": "^2.7.0", | ||
@@ -240,2 +240,3 @@ "progress": "^2.0.3", | ||
"xmlbuilder": "^15.1.1", | ||
"yaml": "1.10.2", | ||
"yup": "^0.32.11" | ||
@@ -259,2 +260,3 @@ }, | ||
"@types/lodash.mergewith": "4.6.7", | ||
"@types/luxon": "^3.1.0", | ||
"@types/mocha": "10.0.1", | ||
@@ -261,0 +263,0 @@ "@types/mustache": "4.2.2", |
@@ -40,2 +40,5 @@ <h1 align="center"> | ||
First, write your main code in `src/index.js`: | ||
```js | ||
@@ -47,5 +50,9 @@ class Greeter { | ||
} | ||
module.exports = { | ||
Greeter | ||
} | ||
``` | ||
First, write your feature in `features/greeting.feature`: | ||
Then, write your feature in `features/greeting.feature`: | ||
@@ -86,3 +93,3 @@ ```gherkin | ||
If you learn best by example, we have [a repo with several example projects](https://github.com/cucumber-examples/cucumber-js-examples), that might help you get going. | ||
If you learn best by example, we have [a repo with several example projects](https://github.com/cucumber/cucumber-js-examples), that might help you get going. | ||
@@ -89,0 +96,0 @@ ## Documentation |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
801781
8076
126
40
57
13
+ Addedluxon@^3.1.1
+ Addedyaml@1.10.2
+ Addedluxon@3.5.0(transitive)
+ Addedyaml@1.10.2(transitive)
- Removedduration@^0.2.2
- Removedd@1.0.2(transitive)
- Removedduration@0.2.2(transitive)
- Removedes5-ext@0.10.64(transitive)
- Removedes6-iterator@2.0.3(transitive)
- Removedes6-symbol@3.1.4(transitive)
- Removedesniff@2.0.1(transitive)
- Removedevent-emitter@0.3.5(transitive)
- Removedext@1.7.0(transitive)
- Removednext-tick@1.1.0(transitive)
- Removedtype@2.7.3(transitive)