Allow running jest tests from plugins

Test Plan:
  - Jenkins passes when a successful test exists in gems/plugins
  - Jenkins fails when a failure test exists in gems/plugins

refs USERS-28

flag = none

Change-Id: I295fdaa5b89ed32dfa89418b86a19e28b2071154
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219040
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
This commit is contained in:
Landon Gilbert-Bland 2019-12-02 08:12:12 -07:00
parent 38e7a93e12
commit a30dc6e1b2
1 changed files with 9 additions and 21 deletions

View File

@ -21,36 +21,24 @@ const {defaults} = require('jest-config')
module.exports = {
moduleNameMapper: {
'^i18n!(.*$)': '<rootDir>/jest/i18nTransformer.js',
"\\.svg$": "<rootDir>/jest/imageMock.js",
'\\.svg$': '<rootDir>/jest/imageMock.js',
'^compiled/(.*)$': '<rootDir>/app/coffeescripts/$1',
'^coffeescripts/(.*)$': '<rootDir>/app/coffeescripts/$1',
'^jsx/(.*)$': '<rootDir>/app/jsx/$1',
'^jst/(.*)$': '<rootDir>/app/views/jst/$1',
"^timezone$": "<rootDir>/public/javascripts/timezone_core.js",
'^timezone$': '<rootDir>/public/javascripts/timezone_core.js',
'node_modules-version-of-backbone': require.resolve('backbone')
},
roots: ['app/jsx', 'app/coffeescripts', 'public/javascripts'],
moduleDirectories: [
'node_modules',
'public/javascripts',
'public/javascripts/vendor'
],
reporters: [ "default", "jest-junit" ],
snapshotSerializers: [
'enzyme-to-json/serializer'
],
setupFiles: [
'jest-localstorage-mock',
'jest-canvas-mock',
'<rootDir>/jest/jest-setup.js'
],
roots: ['app/jsx', 'app/coffeescripts', 'public/javascripts', 'gems/plugins'],
moduleDirectories: ['node_modules', 'public/javascripts', 'public/javascripts/vendor'],
reporters: ['default', 'jest-junit'],
snapshotSerializers: ['enzyme-to-json/serializer'],
setupFiles: ['jest-localstorage-mock', 'jest-canvas-mock', '<rootDir>/jest/jest-setup.js'],
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'./app/jsx/__tests__/ValidatedApolloCleanup'
],
testMatch: [
'**/__tests__/**/?(*.)(spec|test).js'
],
testMatch: ['**/__tests__/**/?(*.)(spec|test).js'],
coverageDirectory: '<rootDir>/coverage-jest/',
@ -65,5 +53,5 @@ module.exports = {
'^.+\\.handlebars': '<rootDir>/jest/handlebarsTransformer.js',
'^.+\\.jsx?$': 'babel-jest',
'\\.graphql$': 'jest-raw-loader'
},
}
}