Skip to content

Commit

Permalink
Test structure change
Browse files Browse the repository at this point in the history
  • Loading branch information
marudor committed Jun 9, 2019
1 parent 7483f3c commit df0c55c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 44 deletions.
21 changes: 3 additions & 18 deletions .gitlab-ci.yml
Expand Up @@ -28,23 +28,9 @@ depCheck:
paths:
- node_modules/

test:server:
jest:
stage: test
script: yarn test:server
cache:
policy: pull
key: '$CI_COMMIT_REF_SLUG'
paths:
- node_modules/
artifacts:
reports:
junit: reports/junitresults.xml
paths:
- reports

test:client:
stage: test
script: yarn test:client
script: yarn test:jest
cache:
policy: pull
key: '$CI_COMMIT_REF_SLUG'
Expand Down Expand Up @@ -113,8 +99,7 @@ codecov:
paths:
- node_modules/
dependencies:
- test:client
- test:server
- jest

docker:server:
services:
Expand Down
8 changes: 8 additions & 0 deletions jest.config.js
@@ -0,0 +1,8 @@
module.exports = {
projects: ['test/client/jest.config.js', 'test/server/jest.config.js'],
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/**/*.{ts,tsx}'],
coverageReporters: ['text-summary', 'lcov'],
coverageDirectory: '<rootDir>/reports',
reporters: ['default', 'jest-junit'],
};
15 changes: 9 additions & 6 deletions package.json
Expand Up @@ -22,10 +22,9 @@
"start:server": "node --inspect devIndex.js",
"tsc": "tsc",
"depCheck": "depcruise --validate .dependency-cruiser.js src",
"test": "npm run lint && npm run depCheck && npm run test:server && npm run test:client && tsc",
"test": "npm run lint && npm run depCheck && npm run test:jest && tsc",
"test:codecov": "codecov",
"test:client": "jest --config test/client/jest.config.js",
"test:server": "TZ=Europe/Berlin jest --config test/server/jest.config.js"
"test:jest": "TZ=Europe/Berlin jest"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
Expand Down Expand Up @@ -129,7 +128,8 @@
"idx": "^2.5.6",
"iltorb": "^2.4.3",
"jest": "^24.8.0",
"jest-dom": "^3.4.0",
"jest-dom": "^3.5.0",
"jest-junit": "^6.4.0",
"jss-snapshot-serializer": "^1.0.0",
"koa-webpack": "^5.2.3",
"lolex": "^4.1.0",
Expand All @@ -139,7 +139,7 @@
"optimize-css-assets-webpack-plugin": "^5.0.1",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.6.0",
"prettier": "^1.18.1",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
Expand Down Expand Up @@ -221,5 +221,8 @@
},
"keywords": [],
"contributors": [],
"homepage": "http://marudor.de"
"homepage": "http://marudor.de",
"jest-junit": {
"output": "./reports/junitresults.xml"
}
}
5 changes: 0 additions & 5 deletions test/client/jest.config.js
Expand Up @@ -5,11 +5,6 @@ module.exports = {
'\\.(scss|css)$': 'identity-obj-proxy',
},
setupFilesAfterEnv: ['<rootDir>/test/client/config.ts'],
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/client/**/*.{ts,tsx}'],
coverageReporters: ['text-summary', 'lcov'],
coverageDirectory: '<rootDir>/reports/client',
rootDir: '../..',
roots: ['<rootDir>/src', '<rootDir>/test/client'],
verbose: false,
};
9 changes: 0 additions & 9 deletions test/server/jest.config.js
Expand Up @@ -5,15 +5,6 @@ module.exports = {
'\\.(scss|css)$': 'identity-obj-proxy',
},
setupFilesAfterEnv: ['<rootDir>/test/server/config.ts'],
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/server/**/*.{ts,tsx}'],
coveragePathIgnorePatterns: [
'<rootDir>/src/server/testData/',
'<rootDir>/src/server/index.ts',
],
coverageReporters: ['text-summary', 'lcov'],
coverageDirectory: '<rootDir>/reports/server',
rootDir: '../..',
roots: ['<rootDir>/src', '<rootDir>/test/server'],
verbose: false,
};
32 changes: 26 additions & 6 deletions yarn.lock
Expand Up @@ -6286,10 +6286,10 @@ jest-docblock@^24.3.0:
dependencies:
detect-newline "^2.1.0"

jest-dom@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/jest-dom/-/jest-dom-3.4.0.tgz#46c21984a73a4841dc57bc8fc09ccd1d971a8447"
integrity sha512-fQR5ESaxTfNbZE02y+gtaQH7+sMwzrQtJo5OE0E3BNArjTL9GWNI+uPFr1yS24eodH1X62L+qncv106M/O98gQ==
jest-dom@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/jest-dom/-/jest-dom-3.5.0.tgz#715908b545c0d66a0eba9d21fc59357fac024f43"
integrity sha512-xHnP3Qo/29oLAo2iixaZsoDrm3XKSVrMH5Wf2ZEiLychJQBTNzOeVMPxrCygCgJiyQMbnymXltme8bPzuiGOIA==
dependencies:
chalk "^2.4.1"
css "^2.2.3"
Expand Down Expand Up @@ -6380,6 +6380,16 @@ jest-jasmine2@^24.8.0:
pretty-format "^24.8.0"
throat "^4.0.0"

jest-junit@^6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-6.4.0.tgz#23e15c979fa6338afde46f2d2ac2a6b7e8cf0d9e"
integrity sha512-GXEZA5WBeUich94BARoEUccJumhCgCerg7mXDFLxWwI2P7wL3Z7sGWk+53x343YdBLjiMR9aD/gYMVKO+0pE4Q==
dependencies:
jest-validate "^24.0.0"
mkdirp "^0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.1"

jest-leak-detector@^24.8.0:
version "24.8.0"
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980"
Expand Down Expand Up @@ -6543,7 +6553,7 @@ jest-util@^24.8.0:
slash "^2.0.0"
source-map "^0.6.0"

jest-validate@^24.8.0:
jest-validate@^24.0.0, jest-validate@^24.8.0:
version "24.8.0"
resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849"
integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==
Expand Down Expand Up @@ -9149,11 +9159,16 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^1.17.0, prettier@^1.18.1:
prettier@^1.17.0:
version "1.18.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.1.tgz#2c79bdc97cbd457fc56e2f37c91cf076d69a8e07"
integrity sha512-cO2Lm9UuFJHhNgHSChbFddQEzNPP+sA6fX1tGmC0VNqTc2X+7EH0gpGWdEX0HfCe5+NVyOyyyWUpLKsb8LU5vg==

prettier@^1.18.2:
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==

pretty-bytes@^5.1.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.2.0.tgz#96c92c6e95a0b35059253fb33c03e260d40f5a1f"
Expand Down Expand Up @@ -11873,6 +11888,11 @@ xml-name-validator@^3.0.0:
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xtend@^4.0.0, xtend@~4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
Expand Down

0 comments on commit df0c55c

Please sign in to comment.