Skip to content

Commit 1f6d4bd

Browse files
authored
Merge pull request #108 from bhanvimenghani/testing_ui
Adds unit test for utility functions
2 parents 96b378f + 96b513e commit 1f6d4bd

File tree

12 files changed

+680
-153
lines changed

12 files changed

+680
-153
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ node_modules/
33

44
# Distribution directories
55
dist/
6+
7+
#jest coverage file
8+
/coverage
9+

jest.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,34 @@ module.exports = {
66
clearMocks: true,
77

88
// Indicates whether the coverage information should be collected while executing the test
9-
collectCoverage: false,
9+
collectCoverage: true,
1010

1111
// The directory where Jest should output its coverage files
1212
coverageDirectory: 'coverage',
1313

1414
// An array of directory names to be searched recursively up from the requiring module's location
15-
moduleDirectories: [
16-
"node_modules",
17-
"<rootDir>/src"
18-
],
15+
moduleDirectories: ['node_modules', '<rootDir>/src'],
1916

2017
// A map from regular expressions to module names that allow to stub out resources with a single module
2118
moduleNameMapper: {
2219
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
23-
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
24-
"@app/(.*)": '<rootDir>/src/app/$1'
20+
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
21+
'<rootDir>/__mocks__/fileMock.js',
22+
'@app/(.*)': '<rootDir>/src/app/$1'
2523
},
2624

2725
// A preset that is used as a base for Jest's configuration
28-
preset: "ts-jest/presets/js-with-ts",
26+
preset: 'ts-jest/presets/js-with-ts',
2927

3028
// The path to a module that runs some code to configure or set up the testing framework before each test
3129
setupFilesAfterEnv: ['<rootDir>/test-setup.js'],
3230

3331
// The test environment that will be used for testing.
34-
testEnvironment: "jsdom",
32+
testEnvironment: 'jsdom',
3533

3634
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
3735
snapshotSerializers: ['enzyme-to-json/serializer'],
3836

37+
// Make tests pass
38+
transformIgnorePatterns: ['/node_modules/(?!(react-syntax-highlighter)/)']
3939
};

0 commit comments

Comments
 (0)