diff --git a/package-lock.json b/package-lock.json index 2d52846aa..8b414f07d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "intern", - "version": "4.2.1-pre", + "version": "4.2.2-pre", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2758,6 +2758,31 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", + "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.5", + "is-windows": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", diff --git a/package.json b/package.json index 9bebb3cd9..c4ae67b97 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "devpack": "intern-dev-build && cd _build/src && npm pack && cp *.tgz ../../", "clean": "intern-dev-clean", "lint": "intern-dev-lint", - "release": "INTERN_BUILD=release intern-dev-release", - "start": "NODE_PATH=_build node _tests/src/bin/intern.js serveOnly", - "test": "NODE_PATH=_build node _tests/src/bin/intern.js", + "release": "cross-env INTERN_BUILD=release intern-dev-release", + "start": "cross-env NODE_PATH=_build node _tests/src/bin/intern.js serveOnly", + "test": "cross-env NODE_PATH=_build node _tests/src/bin/intern.js", "preci": "intern-dev-build", "ci": "npm test config=@ci", "watch": "intern-dev-build watch", @@ -124,6 +124,7 @@ "@types/webpack": "~4.1.3", "ajv": "~6.4.0", "concurrently": "~3.5.0", + "cross-env": "~5.2.0", "css-loader": "~0.28.11", "jsdom": "~11.8.0", "lint-staged": "~7.0.5", @@ -180,4 +181,4 @@ ] }, "pre-commit": "precommit" -} \ No newline at end of file +} diff --git a/tests/unit/lib/middleware/instrument.ts b/tests/unit/lib/middleware/instrument.ts index 5e93d6170..6fa50ab56 100644 --- a/tests/unit/lib/middleware/instrument.ts +++ b/tests/unit/lib/middleware/instrument.ts @@ -10,8 +10,10 @@ import { createMockServerContext } from '../../../support/unit/mocks'; import { mockFs, mockPath, MockStats } from '../../../support/unit/nodeMocks'; +import { normalize } from 'path'; const mockRequire = intern.getPlugin('mockRequire'); +const testPath = normalize('/base/foo/thing.js'); registerSuite('lib/middleware/instrument', function() { let instrument: typeof _instrument; @@ -47,7 +49,10 @@ registerSuite('lib/middleware/instrument', function() { beforeEach() { fs.__fileData = { - '/base/foo/thing.js': { type: 'file', data: 'what a fun time' } + [testPath]: { + type: 'file', + data: 'what a fun time' + } }; server = createMockServer({ basePath: '/base', @@ -107,7 +112,7 @@ registerSuite('lib/middleware/instrument', function() { }, directory() { - fs.__fileData['/base/foo/thing.js']!.type = 'directory'; + fs.__fileData[testPath]!.type = 'directory'; handler(request, response, next); @@ -120,9 +125,8 @@ registerSuite('lib/middleware/instrument', function() { sandbox .stub(fs, 'stat') .callsFake((path: string, callback: any) => { - const data = - fs.__fileData['/base/foo/thing.js']; - fs.__fileData['/base/foo/thing.js'] = undefined; + const data = fs.__fileData[testPath]; + fs.__fileData[testPath] = undefined; callback( undefined, new MockStats(path, data!.type) diff --git a/webpack.config.ts b/webpack.config.ts index da7e1e89f..01eb1048d 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -12,7 +12,7 @@ const common: Configuration = { module: { rules: [ { - test: /@dojo\//, + test: /@dojo[\\\/]/, use: 'umd-compat-loader' }, { @@ -29,7 +29,7 @@ const common: Configuration = { } } ], - noParse: /benchmark\/benchmark.js/ + noParse: /benchmark[\\\/]benchmark.js/ }, performance: { // Hides a warning about large bundles.