Skip to content

Commit

Permalink
feat(jasmine): add basic ESM support
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wiles committed Jan 27, 2022
1 parent 3708899 commit fab02f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jasmine/jasmine_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (TOTAL_SHARDS) {
// the maximum (See: https://nodejs.org/api/errors.html#errors_error_stacktracelimit)
Error.stackTraceLimit = Infinity;

const IS_TEST_FILE = /[^a-zA-Z0-9](spec|test)\.js$/i;
const IS_TEST_FILE = /[^a-zA-Z0-9](spec|test)\.(mjs|js)$/i;
const IS_NODE_MODULE = /\/node_modules\//

// We process arguments by splicing them out of the process.argv
Expand Down
7 changes: 7 additions & 0 deletions packages/jasmine/test/esm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("//packages/jasmine:index.bzl", "jasmine_node_test")


jasmine_node_test(
name = "jasmine_import",
srcs = ["jasmine_import.spec.mjs"],
)
6 changes: 6 additions & 0 deletions packages/jasmine/test/esm/jasmine_import.spec.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

describe('spec in file ending with *.mjs', () => {
it('should run', () => {
expect(true).toBe(true);
});
});

0 comments on commit fab02f1

Please sign in to comment.