-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test react-router(-dom) source, CJS, and UMD
- Loading branch information
Showing
25 changed files
with
988 additions
and
531 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ es | |
node_modules | ||
umd | ||
/*.js | ||
!jest.config.js | ||
!rollup.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let mappedModule; | ||
switch (process.env.TEST_ENV) { | ||
case "cjs": | ||
mappedModule = "<rootDir>/index"; | ||
break; | ||
case "umd": | ||
mappedModule = "<rootDir>/umd/react-router-dom.js"; | ||
break; | ||
default: | ||
mappedModule = "<rootDir>/modules/index"; | ||
} | ||
|
||
module.exports = { | ||
testMatch: ["<rootDir>/modules/__tests__/*-test.js"], | ||
moduleNameMapper: { | ||
"^react-router-dom$": mappedModule | ||
}, | ||
globals: { | ||
"__DEV__": true | ||
}, | ||
setupFiles: [ | ||
"raf/polyfill" | ||
], | ||
testURL: "http://localhost/" | ||
}; |
2 changes: 1 addition & 1 deletion
2
packages/react-router-dom/modules/__tests__/BrowserRouter-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const execSync = require("child_process").execSync; | ||
|
||
const exec = (command, extraEnv) => | ||
execSync(command, { | ||
stdio: "inherit", | ||
env: Object.assign({}, process.env, extraEnv) | ||
}); | ||
|
||
console.log("Testing source files"); | ||
|
||
exec("jest", { | ||
TEST_ENV: "source" | ||
}); | ||
|
||
console.log("Testing commonjs build"); | ||
|
||
exec("jest", { | ||
TEST_ENV: "cjs" | ||
}); | ||
|
||
console.log("Testing UMD build"); | ||
|
||
exec("jest", { | ||
TEST_ENV: "umd" | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
umd | ||
utils | ||
/*.js | ||
!jest.config.js | ||
!rollup.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let mappedModule; | ||
switch (process.env.TEST_ENV) { | ||
case "cjs": | ||
mappedModule = "<rootDir>/index"; | ||
break; | ||
case "umd": | ||
mappedModule = "<rootDir>/umd/react-router.js"; | ||
break; | ||
default: | ||
mappedModule = "<rootDir>/modules/index"; | ||
} | ||
|
||
module.exports = { | ||
testMatch: ["<rootDir>/modules/__tests__/*-test.js"], | ||
moduleNameMapper: { | ||
"^react-router$": mappedModule | ||
}, | ||
globals: { | ||
"__DEV__": true | ||
}, | ||
setupFiles: [ | ||
"raf/polyfill" | ||
], | ||
testURL: "http://localhost/" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.