Skip to content

Commit b4784f1

Browse files
committed
Use regexp to assert endsWith
This gives a more appropriate error message upon failure, which would otherwise just be "expected false to be true".
1 parent 49a0400 commit b4784f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/json_config.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Feature: JSON config
55
And a file named "assert_args_and_exec.js" with:
66
"""
77
const assert = require("assert/strict");
8-
assert(process.argv[0].endsWith("node"));
9-
assert(process.argv[1].endsWith("assert_args_and_exec.js"));
8+
assert.match(process.argv[0], /node$/);
9+
assert.match(process.argv[1], /assert_args_and_exec\.js$/);
1010
assert.equal(process.argv[2], "cucumber-json-formatter");
1111
require("child_process").execSync(process.argv[2], { stdio: "inherit" });
1212
"""

0 commit comments

Comments
 (0)