There are things that will happen in all of our test files that we can handle in a centralized fashion. In this lesson, we’ll create a jest configuration file and a test setup file to import utilities that we want to make available for all of our tests.
FYI now getting deprecation warning:
Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.
This new flag takes an array:
module.exports = {
setupFilesAfterEnv: ['<rootDir>/testSetup.js']
};
FYI now getting deprecation warning:
Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.
This new flag takes an array:
module.exports = {
setupFilesAfterEnv: ['<rootDir>/testSetup.js']
};
This is a change that was made in Jest 24, which was just released 2 days ago. Nice to see useful deprecation messages 🙂