Commit 224417e2 authored by Phil Hughes's avatar Phil Hughes Committed by Filipa Lacerda

Added GraphQL Jest transform

parent b0097199
...@@ -20,6 +20,7 @@ module.exports = { ...@@ -20,6 +20,7 @@ module.exports = {
'^ee(.*)$': '<rootDir>/ee/app/assets/javascripts$1', '^ee(.*)$': '<rootDir>/ee/app/assets/javascripts$1',
'^helpers(.*)$': '<rootDir>/spec/frontend/helpers$1', '^helpers(.*)$': '<rootDir>/spec/frontend/helpers$1',
'^vendor(.*)$': '<rootDir>/vendor/assets/javascripts$1', '^vendor(.*)$': '<rootDir>/vendor/assets/javascripts$1',
'\\.(jpg|jpeg|png|svg)$': '<rootDir>/spec/frontend/__mocks__/file_mock.js',
}, },
collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'], collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/coverage-frontend/', coverageDirectory: '<rootDir>/coverage-frontend/',
...@@ -30,6 +31,7 @@ module.exports = { ...@@ -30,6 +31,7 @@ module.exports = {
setupTestFrameworkScriptFile: '<rootDir>/spec/frontend/test_setup.js', setupTestFrameworkScriptFile: '<rootDir>/spec/frontend/test_setup.js',
restoreMocks: true, restoreMocks: true,
transform: { transform: {
'^.+\\.(gql|graphql)$': 'jest-transform-graphql',
'^.+\\.js$': 'babel-jest', '^.+\\.js$': 'babel-jest',
'^.+\\.vue$': 'vue-jest', '^.+\\.vue$': 'vue-jest',
}, },
......
...@@ -6371,6 +6371,11 @@ jest-snapshot@^23.6.0: ...@@ -6371,6 +6371,11 @@ jest-snapshot@^23.6.0:
pretty-format "^23.6.0" pretty-format "^23.6.0"
semver "^5.5.0" semver "^5.5.0"
jest-transform-graphql@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/jest-transform-graphql/-/jest-transform-graphql-2.1.0.tgz#903cb66bb27bc2772fd3e5dd4f7e9b57230f5829"
integrity sha1-kDy2a7J7wncv0+XdT36bVyMPWCk=
jest-util@^23.4.0: jest-util@^23.4.0:
version "23.4.0" version "23.4.0"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment