Make core translations and svg imports available in jest

Refs COMMS-1751

Test Plan:
  - Jenkins is happy

Change-Id: Ibe3e7ce2b22f7acd4ba7a80a84eb5a4fff5bf645
Reviewed-on: https://gerrit.instructure.com/173628
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@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 2018-11-28 15:50:44 -07:00
parent 95d3d721aa
commit 56f9882e41
3 changed files with 22 additions and 1 deletions

View File

@ -21,7 +21,8 @@ module.exports = {
'^i18n!(.*$)': '<rootDir>/jest/i18nTransformer.js',
'^compiled/(.*)$': '<rootDir>/app/coffeescripts/$1',
'^jsx/(.*)$': '<rootDir>/app/jsx/$1',
"^timezone$": "<rootDir>/public/javascripts/timezone_core.js"
"^timezone$": "<rootDir>/public/javascripts/timezone_core.js",
"\\.svg$": "<rootDir>/jest/imageMock.js"
},
roots: ['app/jsx'],
moduleDirectories: [

View File

@ -17,5 +17,6 @@
*/
const I18n = require('../public/javascripts/i18nObj')
const core_translations = require('../public/javascripts/translations/_core_en.js')
module.exports = I18n.scoped('fakeScopeUsedForTestingInJest')

19
jest/imageMock.js Normal file
View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2017 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module.exports = ''