Skip to content

Commit bddeb3d

Browse files
authored
chore: move karma related devdeps to repo root (#1292)
* chore: move karma related devdeps to repo root * chore: update lock file * test(middleware-sdk-transcribe-streaming): fix unit tests
1 parent 8f3fdc0 commit bddeb3d

File tree

6 files changed

+269
-486
lines changed

6 files changed

+269
-486
lines changed

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@
4545
"fs-extra": "^9.0.0",
4646
"generate-changelog": "^1.7.1",
4747
"husky": "^4.2.3",
48+
"jasmine-core": "^3.5.0",
4849
"jest": "^25.1.0",
4950
"jmespath": "^0.15.0",
51+
"karma": "^5.1.0",
52+
"karma-chrome-launcher": "^3.1.0",
53+
"karma-coverage": "^2.0.2",
54+
"karma-jasmine": "^3.3.1",
55+
"karma-typescript": "^5.0.3",
5056
"lerna": "3.22.1",
5157
"lint-staged": "^10.0.1",
5258
"prettier": "2.0.5",
59+
"puppeteer": "^4.0.0",
5360
"typescript": "~3.8.3",
5461
"yarn": "1.22.4"
5562
},
@@ -61,7 +68,9 @@
6168
],
6269
"nohoist": [
6370
"**/karma*",
64-
"**/karma*/**"
71+
"**/karma*/**",
72+
"**/@types/mocha*",
73+
"**/@types/mocha*/**"
6574
]
6675
},
6776
"husky": {

packages/fetch-http-handler/package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
"devDependencies": {
2525
"@aws-sdk/abort-controller": "1.0.0-gamma.1",
2626
"@types/jest": "^25.1.4",
27-
"jasmine-core": "^3.5.0",
28-
"karma": "^4.4.1",
29-
"karma-chrome-launcher": "^3.1.0",
30-
"karma-jasmine": "^3.1.1",
31-
"karma-typescript": "^4.1.1",
32-
"puppeteer": "^3.0.1",
33-
"source-map": "^0.7.3",
3427
"typescript": "~3.8.3"
3528
}
3629
}
Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,26 @@
1-
// Karma configuration
2-
31
process.env.CHROME_BIN = require("puppeteer").executablePath();
4-
52
module.exports = function (config) {
63
config.set({
7-
// base path that will be used to resolve all patterns (eg. files, exclude)
8-
basePath: "",
9-
10-
// frameworks to use
11-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
124
frameworks: ["jasmine", "karma-typescript"],
13-
14-
// list of files / patterns to load in the browser
155
files: ["src/**/*.ts"],
16-
17-
// list of files / patterns to exclude
18-
exclude: [],
19-
20-
// preprocess matching files before serving them to the browser
21-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
6+
exclude: ["**/*.d.ts"],
227
preprocessors: {
23-
"src/**/*.ts": "karma-typescript"
8+
"**/*.ts": "karma-typescript"
249
},
25-
26-
// test results reporter to use
27-
// possible values: 'dots', 'progress'
28-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
29-
reporters: ["progress", "coverage", "karma-typescript"],
30-
31-
karmaTypescriptConfig: {
32-
tsconfig: "./tsconfig.json",
33-
bundlerOptions: {
34-
addNodeGlobals: false
35-
}
36-
},
37-
38-
// web server port
39-
port: 9876,
40-
41-
// enable / disable colors in the output (reporters and logs)
42-
colors: true,
43-
44-
// level of logging
45-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
46-
logLevel: config.LOG_INFO,
47-
48-
// enable / disable watching file and executing tests whenever any file changes
49-
autoWatch: false,
50-
10+
reporters: ["progress", "karma-typescript"],
5111
browsers: ["ChromeHeadlessNoSandbox"],
5212
customLaunchers: {
5313
ChromeHeadlessNoSandbox: {
5414
base: "ChromeHeadless",
5515
flags: ["--no-sandbox"]
5616
}
5717
},
58-
59-
// Continuous Integration mode
60-
// if true, Karma captures browsers, runs the tests and exits
61-
singleRun: true,
62-
63-
// Concurrency level
64-
// how many browser should be started simultaneous
65-
concurrency: Infinity
18+
karmaTypescriptConfig: {
19+
tsconfig: "./tsconfig.json",
20+
bundlerOptions: {
21+
addNodeGlobals: false
22+
}
23+
},
24+
singleRun: true
6625
});
6726
};

packages/hash-blob-browser/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@
2323
"@aws-crypto/sha256-js": "^1.0.0-alpha.0",
2424
"@aws-sdk/util-hex-encoding": "1.0.0-gamma.1",
2525
"@types/jest": "^25.1.4",
26-
"jasmine-core": "^3.4.0",
2726
"jest": "^25.1.0",
28-
"karma": "^4.1.0",
29-
"karma-chrome-launcher": "^3.0.0",
30-
"karma-jasmine": "^3.1.1",
31-
"karma-typescript": "^4.0.0",
32-
"puppeteer": "^3.0.1",
3327
"typescript": "~3.8.3"
3428
},
3529
"react-native": {

packages/middleware-sdk-transcribe-streaming/src/websocket-handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe("WebSocketHandler", () => {
6565
expect(err.$metadata).toBeDefined();
6666
expect(err.$metadata.httpStatusCode >= 500).toBe(true);
6767
expect(
68-
(global.setTimeout as jest.Mock).mock.calls.filter(args => {
68+
((global as any).setTimeout as jest.Mock).mock.calls.filter(args => {
6969
//find the 'setTimeout' call from the websocket handler
7070
return args[0].toString().indexOf("$metadata") >= 0;
7171
})[0][1]

0 commit comments

Comments
 (0)