-
Notifications
You must be signed in to change notification settings - Fork 0
test(KP-448): improve test config and introduce ts in /shared #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
belanglos
wants to merge
12
commits into
master
Choose a base branch
from
issues/KP-448-lyft-kod-i-shared-som-ts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
01eb486
test(KP-448): improve test config and introduce ts in /shared
belanglos de99736
build(KP-448): let public and server use domain and shared
belanglos 30b7a92
test(KP-448): gitignore test coverage
belanglos 7802443
ref(KP-448): move and ts-ify files into /shared
belanglos 1e2d4eb
build(KP-448): let public and server use domain and shared
belanglos 9f75742
ci(KP-448): run npm test on agent host instead of docker from pr-pipe…
belanglos a679421
ci(KP-448): add npm build custom command
belanglos 70ec72e
ci(KP-448): remove integration tests in pr-pipeline
belanglos f57eb9a
ref(KP-448): remove unused function formatIsoDate
belanglos 8c443f0
ci(KP-448): remove integration tests in ref-pipeline
belanglos a973387
ci(KP-448): run npm test on agent host instead of docker ref ref-pipe…
belanglos 5302a6c
docs(KP-448): added TSDoc to semesterUtils
belanglos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| { | ||
| "extends": ["@kth/eslint-config-kth"], | ||
| "rules": { | ||
| "react/prop-types": "warn" | ||
| } | ||
| "react/prop-types": "warn", | ||
| }, | ||
| "settings": { | ||
| "import/resolver": { | ||
| "webpack": { "config": "webpack.config.js" }, | ||
| }, | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // jest.base.js | ||
| module.exports = { | ||
| clearMocks: true, | ||
| transformIgnorePatterns: ['node_modules/(?!(@kth|@babel|@jest|uuid|nanoid)/)'], | ||
| moduleNameMapper: { | ||
| '^shared/(.*)$': '<rootDir>/shared/$1', | ||
| '^domain/(.*)$': '<rootDir>/domain/$1', | ||
| '\\.(css|less|scss|sass)$': '<rootDir>/public/__mocks__/styleMock.js', | ||
| }, | ||
| setupFilesAfterEnv: ['jest-extended/all'], | ||
| moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const base = require('./jest.base') | ||
|
|
||
| module.exports = { | ||
| ...base, | ||
| displayName: 'client', | ||
| testEnvironment: 'jsdom', | ||
|
|
||
| // ✅ anchor project to the folder | ||
| roots: ['<rootDir>/public'], | ||
|
|
||
| // ✅ relative patterns now that roots is set | ||
| testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], | ||
|
|
||
| // keep ignores relative to roots | ||
| testPathIgnorePatterns: ['<rootDir>/public/dist/', '<rootDir>/node_modules/'], | ||
|
|
||
| transform: { | ||
| '^.+\\.tsx?$': ['ts-jest', { tsconfig: '<rootDir>/public/tsconfig.json' }], | ||
| '^.+\\.[jt]sx?$': 'babel-jest', | ||
| }, | ||
| moduleNameMapper: { | ||
| '\\.(css|less|scss|sass)$': '<rootDir>/public/__mocks__/styleMock.js', | ||
| '^@kth/kopps-public-react-web/shared/(.*)$': '<rootDir>/shared/dist/$1', | ||
| '^@kth/kopps-public-react-web/domain/(.*)$': '<rootDir>/domain/$1', | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| module.exports = { | ||
| globals: { | ||
| NODE_ENV: 'test', | ||
| }, | ||
| clearMocks: true, | ||
| notify: true, | ||
| notifyMode: 'failure-change', | ||
| transformIgnorePatterns: ['node_modules/(?!(@kth|@babel|@jest|uuid|nanoid)/)'], | ||
| moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'], | ||
| moduleNameMapper: { | ||
| '\\.(css|less|scss|sass)$': '<rootDir>/public/__mocks__/styleMock.js', | ||
| }, | ||
| setupFilesAfterEnv: ['jest-extended/all'], | ||
| testEnvironment: 'jsdom', | ||
| verbose: true, | ||
| projects: [ | ||
| '<rootDir>/jest.client.config.js', | ||
| '<rootDir>/jest.shared.config.js', | ||
| '<rootDir>/jest.domain.config.js', | ||
| '<rootDir>/jest.server.config.js', | ||
| ], | ||
| reporters: [ | ||
| 'default', | ||
| ['summary', { summaryThreshold: 0 }], // Enable failed test summary at the end of test run | ||
| ], | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| const base = require('./jest.base') | ||
|
|
||
| module.exports = { | ||
| ...base, | ||
| displayName: 'domain', | ||
| testEnvironment: 'node', | ||
| roots: ['<rootDir>/domain'], | ||
| testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], | ||
| testPathIgnorePatterns: ['<rootDir>/node_modules/'], | ||
| transform: { '^.+\\.[jt]sx?$': 'babel-jest' }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| const base = require('./jest.base') | ||
|
|
||
| module.exports = { | ||
| ...base, | ||
| displayName: 'server', | ||
| testEnvironment: 'node', | ||
| roots: ['<rootDir>/server'], | ||
| testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], | ||
| testPathIgnorePatterns: ['<rootDir>/node_modules/'], | ||
| transform: { '^.+\\.[jt]sx?$': 'babel-jest' }, | ||
| moduleNameMapper: { | ||
| '^kopps-public-react-web/shared/(.*)$': '<rootDir>/shared/dist/$1', | ||
| '^kopps-public-react-web/domain/(.*)$': '<rootDir>/domain/$1', | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| const base = require('./jest.base') | ||
|
|
||
| module.exports = { | ||
| ...base, | ||
| displayName: 'shared', | ||
| testEnvironment: 'node', | ||
| roots: ['<rootDir>/shared'], | ||
| testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], | ||
| testPathIgnorePatterns: ['<rootDir>/shared/dist/', '<rootDir>/node_modules/'], | ||
| transform: { | ||
| '^.+\\.tsx?$': ['ts-jest', { tsconfig: '<rootDir>/shared/tsconfig.json' }], | ||
| }, | ||
| moduleNameMapper: { | ||
| '^kopps-public-react-web/shared/(.*)$': '<rootDir>/shared/$1', | ||
| '^kopps-public-react-web/domain/(.*)$': '<rootDir>/domain/$1', | ||
| }, | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.