Skip to content

Commit

Permalink
[WIP] Feature tests (#750)
Browse files Browse the repository at this point in the history
* base test

* fix: setupEnzyme.ts path

* remove dep on ts-jest

* bump snap

* bump snap + remove @types deps

* updated package.json

* borrow yarn.lock

* working

* fix base tests

* add test with tabs

* test setup

* remove lints

* recover localDevIndex from master
  • Loading branch information
Divyendu Singh authored and timsuchanek committed Jul 6, 2018
1 parent 62ecfdb commit d0af123
Show file tree
Hide file tree
Showing 8 changed files with 929 additions and 9 deletions.
21 changes: 21 additions & 0 deletions packages/graphql-playground-react/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^.+\\.tsx?$': '<rootDir>/config/jest/typescriptTransform.js',
'^(?!.*\\.(css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
testPathIgnorePatterns: ['<rootDir>[/\\\\](build|docs|node_modules)[/\\\\]'],
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
snapshotSerializers: ['enzyme-to-json/serializer'],
setupTestFrameworkScriptFile: '<rootDir>/src/setupEnzyme.ts',
globals: {
'ts-jest': {
tsConfigFile: 'tsconfig.jest.json',
},
},
setupFiles: ['<rootDir>/config/polyfills.js', 'jest-localstorage-mock'],
}
7 changes: 6 additions & 1 deletion packages/graphql-playground-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"tsc": "tsc -p tsconfig.build.json",
"build-package": "rimraf lib build/dist && npm run tsc && babel lib -d lib && cp -r ./src/assets/ ./lib/assets/ && cd lib && rimraf *.jsx;",
"build-app": "node scripts/build.js",
"test": "bundlesize",
"test": "jest",
"bundlesize": "bundlesize",
"bump": "npm version patch --no-git-tag-version && git add package.json",
"graphql-faker": "graphql-faker ./tests/schema.faker.graphql",
"lint": "tslint \"src/**/*.ts{,x}\"",
Expand Down Expand Up @@ -63,6 +64,9 @@
"css-loader": "0.28.11",
"detect-port": "1.2.3",
"dotenv": "5.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.11",
"filesize": "3.6.1",
Expand All @@ -73,6 +77,7 @@
"http-proxy-middleware": "0.17.4",
"husky": "0.14.3",
"jest": "22.1.4",
"jest-localstorage-mock": "^2.2.0",
"json-loader": "0.5.7",
"lint-staged": "6.1.0",
"node-noop": "1.0.0",
Expand Down
Loading

0 comments on commit d0af123

Please sign in to comment.