-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Our Mocha and Jest configuration has been messy because we're in the middle of a migration from Mocha to Jest. Each file had to be explicitly included in the Jest configuration or ignored in the Mocha configuration. This was inconvenient and error-prone, and resulted in some tests not being run at all. Both test configurations have been updated to use a shared list of Mocha test files. There are only a few of these files left, and this list should only get shorter as we migrate more tests to Jest. No further configuration changes will be needed to add Jest tests.
- Loading branch information
Showing
5 changed files
with
55 additions
and
95 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,19 +1,6 @@ | ||
module.exports = { | ||
// TODO: Remove the `exit` setting, it can hide broken tests. | ||
exit: true, | ||
ignore: [ | ||
'./app/scripts/lib/**/*.test.js', | ||
'./app/scripts/migrations/*.test.js', | ||
'./app/scripts/platforms/*.test.js', | ||
'./app/scripts/controllers/app-state.test.js', | ||
'./app/scripts/controllers/permissions/**/*.test.js', | ||
'./app/scripts/controllers/mmi-controller.test.ts', | ||
'./app/scripts/controllers/preferences.test.js', | ||
'./app/scripts/constants/error-utils.test.js', | ||
'./app/scripts/metamask-controller.test.js', | ||
'./development/fitness-functions/**/*.test.ts', | ||
'./test/e2e/helpers.test.js', | ||
], | ||
recursive: true, | ||
require: ['test/env.js', 'test/setup.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This is a list of remaining unit tests written for Mocha. | ||
// We are in the middle of a migration from Mocha to Jest. Please do not add any additional test | ||
// files to this list. We should only be removing files. | ||
const legacyMochaTests = [ | ||
'app/scripts/controllers/metametrics.test.js', | ||
'app/scripts/controllers/swaps.test.js', | ||
'app/scripts/detect-multiple-instances.test.js', | ||
'app/scripts/metamask-controller.actions.test.js', | ||
] | ||
|
||
const legacyMochaTestCoveredFiles = [ | ||
'app/scripts/controllers/metametrics.js', | ||
'app/scripts/controllers/swaps.js', | ||
'app/scripts/detect-multiple-instances.js', | ||
// Intentionally omitted because it's partially covered by Jest tests as well | ||
// Lets consider the Jest coverage as the authority on what is covered here, since we'll be | ||
// migrating these tests to Jest eventually. | ||
// 'app/scripts/metamask-controller.js' | ||
] | ||
|
||
module.exports = { | ||
legacyMochaTests, | ||
legacyMochaTestCoveredFiles, | ||
} |
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