Skip to content

Commit

Permalink
Use .mjs for tests to force ESM module loader
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec committed Aug 6, 2019
1 parent 38c1fce commit e448c0c
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"tsc-watch": "tsc -w",
"test": "npm run tsc && npm run test-core && npm run test-duplex",
"test-sauce": "npm run build && node test/Sauce/Runner.js",
"test-duplex": "node --experimental-modules jasmine-run.js test/**/*[sS]pec.js",
"test-core": "node --experimental-modules jasmine-run.js test/spec/jsonPatchTestsSpec.js test/spec/coreSpec.js test/spec/validateSpec.js",
"test-duplex": "node --experimental-modules jasmine-run.mjs test/**/*[sS]pec.mjs",
"test-core": "node --experimental-modules jasmine-run.mjs test/spec/jsonPatchTestsSpec.mjs test/spec/coreSpec.mjs test/spec/validateSpec.mjs",
"bench": "npm run bench-core && npm run bench-duplex",
"bench-core": "node test/spec/coreBenchmark.js",
"bench-duplex": "node test/spec/coreBenchmark.js && node test/spec/duplexBenchmark.js"
Expand Down
8 changes: 4 additions & 4 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<script src="../dist/fast-json-patch.js"></script>

<!-- Dynamically load https://github.com/json-patch/json-patch-tests test suite -->
<script type="module" src="spec/jsonPatchTestsSpec.js"></script>
<script type="module" src="spec/coreSpec.js"></script>
<script type="module" src="spec/validateSpec.js"></script>
<script type="module" src="spec/duplexSpec.js"></script>
<script type="module" src="spec/jsonPatchTestsSpec.mjs"></script>
<script type="module" src="spec/coreSpec.mjs"></script>
<script type="module" src="spec/validateSpec.mjs"></script>
<script type="module" src="spec/duplexSpec.mjs"></script>
<script src="spec/duplexBenchmark.js"></script>
<script src="spec/coreBenchmark.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion test/spec/coreSpec.js → test/spec/coreSpec.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as jsonpatch from '../../module/duplex.js';
import * as jsonpatch from '../../module/duplex.mjs';

describe('jsonpatch.getValueByPointer', function() {
it('should retrieve values by JSON pointer from tree - deep object', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/duplexSpec.js → test/spec/duplexSpec.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as jsonpatch from '../../module/duplex.js';
import * as jsonpatch from '../../module/duplex.mjs';
import {EventTarget, defineEventAttribute} from "../../node_modules/event-target-shim/dist/event-target-shim.mjs";

if (typeof window === 'undefined') {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as jsonpatch from '../../module/duplex.js';
import * as jsonpatch from '../../module/duplex.mjs';

import tests_json from './json-patch-tests/tests.json.js';
import spec_tests_json from './json-patch-tests/spec_tests.json.js';
import tests_json from './json-patch-tests/tests.json.mjs';
import spec_tests_json from './json-patch-tests/spec_tests.json.mjs';

const JSONtests = [
{
Expand Down
2 changes: 1 addition & 1 deletion test/spec/validateSpec.js → test/spec/validateSpec.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as jsonpatch from '../../module/duplex.js';
import * as jsonpatch from '../../module/duplex.mjs';

describe('validate', function() {
it('should return an empty array if the patch is valid', function() {
Expand Down

0 comments on commit e448c0c

Please sign in to comment.