Skip to content

Commit cdfff82

Browse files
committed
fix: issues resolved with tests
1 parent ac1f9a0 commit cdfff82

File tree

16 files changed

+299
-42
lines changed

16 files changed

+299
-42
lines changed

jest.backend.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'<rootDir>/node_modules/regenerator-runtime/runtime',
99
'<rootDir>/scripts/config/polyfills.js'
1010
],
11-
setupTestFrameworkScriptFile: '<rootDir>/scripts/config/jest/setup.js',
11+
setupFilesAfterEnv: ['<rootDir>/scripts/config/jest/setup.js'],
1212
testMatch: [
1313
'<rootDir>/src/server/app/modules/**/*.spec.{ts,tsx,mjs}',
1414
'<rootDir>/src/server/app/common/interceptors/**/*.spec.{ts,tsx,mjs}',
@@ -27,7 +27,7 @@ module.exports = {
2727
testEnvironment: 'node',
2828
testURL: 'http://localhost',
2929
transform: {
30-
'^.+\\.tsx?$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
30+
'^.+\\.tsx?$': 'ts-jest',
3131
'^.+\\.css$': '<rootDir>/scripts/config/jest/cssTransform.js',
3232
'^(?!.*\\.(js|jsx|mjs|css|json)$)':
3333
'<rootDir>/scripts/config/jest/fileTransform.js'

jest.e2e.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
],
99
transform: {
1010
'^.+\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
11-
'^.+\\.(ts|tsx|mjs)$': '<rootDir>/node_modules/ts-jest',
11+
'^.+\\.(ts|tsx|mjs)$': 'ts-jest',
1212
'^.+\\.css$': '<rootDir>/scripts/config/jest/cssTransform.js',
1313
'^(?!.*\\.(js|jsx|mjs|css|json)$)':
1414
'<rootDir>/scripts/config/jest/fileTransform.js'

jest.frontend.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'<rootDir>/scripts/config/polyfills.js'
99
],
1010
snapshotSerializers: ['enzyme-to-json/serializer'],
11-
setupTestFrameworkScriptFile: '<rootDir>/scripts/config/jest/setup.js',
11+
setupFilesAfterEnv: ['<rootDir>/scripts/config/jest/setup.js'],
1212
testMatch: [
1313
'<rootDir>/src/client/web/**/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}',
1414
'<rootDir>/src/client/shared/**/?(*.)(spec|test).{js,jsx,ts,tsx,mjs}'
@@ -50,7 +50,7 @@ module.exports = {
5050
testURL: 'http://localhost',
5151
transform: {
5252
'^.+\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
53-
'\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
53+
'\\.(ts|tsx)$': 'ts-jest',
5454
'^.+\\.css$': '<rootDir>/scripts/config/jest/cssTransform.js',
5555
'^(?!.*\\.(js|jsx|mjs|css|json)$)':
5656
'<rootDir>/scripts/config/jest/fileTransform.js'

package-lock.json

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
"tsconfig-paths-webpack-plugin": "3.2.0",
187187
"tslint": "5.17.0",
188188
"typedoc": "0.19.1",
189-
"typescript": "3.7.2",
189+
"typescript": "4.0.3",
190190
"url-loader": "2.1.0",
191191
"webpack": "4.43.0",
192192
"webpack-bundle-analyzer": "3.8.0",

src/client/shared/config/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ export const webConfig = {
1717
};
1818

1919
export const config = {
20-
WS_PROTOCOL:
21-
process.env.NODE_ENV === 'development'
22-
? 'ws://'
23-
: process.env.WS_PROTOCOL,
24-
WS_URL:
25-
process.env.NODE_ENV === 'development'
26-
? 'localhost:3000'
27-
: process.env.WS_URL,
28-
API_URL:
29-
process.env.NODE_ENV === 'development'
30-
? 'http://localhost:3000'
31-
: '/api',
32-
LOGIN_URL: '/auth/github',
33-
...webConfig
34-
};
20+
WS_PROTOCOL:
21+
process.env.NODE_ENV === 'development'
22+
? 'ws://'
23+
: process.env.WS_PROTOCOL,
24+
WS_URL:
25+
process.env.NODE_ENV === 'development'
26+
? 'localhost:3000'
27+
: process.env.WS_URL,
28+
API_URL:
29+
process.env.NODE_ENV === 'development'
30+
? 'http://localhost:3000'
31+
: '/api',
32+
LOGIN_URL: '/auth/github',
33+
...webConfig
34+
};

src/client/shared/services/chat/__tests__/chat-service.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,12 @@ describe('Chat Service', () => {
3838
});
3939
expect(requestRemoveChat).toBeDefined();
4040
});
41+
42+
it('can request All chats', () => {
43+
const requestRemoveChat = ChatServiceEngine.requestAllChatsRest({
44+
apolloClientMock,
45+
data: {}
46+
});
47+
expect(requestRemoveChat).toBeDefined();
48+
});
4149
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`AppHeaderComponent <AppHeaderComponent /> AppHeader Component renders correctly 1`] = `[Function]`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`ChatHeaderComponent <ChatHeaderComponent /> ChatHeader Component renders correctly 1`] = `[Function]`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`ChatMainComponent <ChatMainComponent /> ChatMain Component renders correctly 1`] = `[Function]`;

0 commit comments

Comments
 (0)