Skip to content

chore: move karma related devdeps to repo root #1292

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

Merged
merged 3 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@
"fs-extra": "^9.0.0",
"generate-changelog": "^1.7.1",
"husky": "^4.2.3",
"jasmine-core": "^3.5.0",
"jest": "^25.1.0",
"jmespath": "^0.15.0",
"karma": "^5.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.2",
"karma-jasmine": "^3.3.1",
"karma-typescript": "^5.0.3",
"lerna": "3.22.1",
"lint-staged": "^10.0.1",
"prettier": "2.0.5",
"puppeteer": "^4.0.0",
"typescript": "~3.8.3",
"yarn": "1.22.4"
},
Expand All @@ -61,7 +68,9 @@
],
"nohoist": [
"**/karma*",
"**/karma*/**"
"**/karma*/**",
"**/@types/mocha*",
"**/@types/mocha*/**"
]
},
"husky": {
Expand Down
7 changes: 0 additions & 7 deletions packages/fetch-http-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
"devDependencies": {
"@aws-sdk/abort-controller": "1.0.0-gamma.1",
"@types/jest": "^25.1.4",
"jasmine-core": "^3.5.0",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-jasmine": "^3.1.1",
"karma-typescript": "^4.1.1",
"puppeteer": "^3.0.1",
"source-map": "^0.7.3",
"typescript": "~3.8.3"
}
}
61 changes: 10 additions & 51 deletions packages/hash-blob-browser/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,26 @@
// Karma configuration

process.env.CHROME_BIN = require("puppeteer").executablePath();

module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "",

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["jasmine", "karma-typescript"],

// list of files / patterns to load in the browser
files: ["src/**/*.ts"],

// list of files / patterns to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
exclude: ["**/*.d.ts"],
preprocessors: {
"src/**/*.ts": "karma-typescript"
"**/*.ts": "karma-typescript"
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ["progress", "coverage", "karma-typescript"],

karmaTypescriptConfig: {
tsconfig: "./tsconfig.json",
bundlerOptions: {
addNodeGlobals: false
}
},

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

reporters: ["progress", "karma-typescript"],
browsers: ["ChromeHeadlessNoSandbox"],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox"]
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
karmaTypescriptConfig: {
tsconfig: "./tsconfig.json",
bundlerOptions: {
addNodeGlobals: false
}
},
singleRun: true
});
};
6 changes: 0 additions & 6 deletions packages/hash-blob-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
"@aws-crypto/sha256-js": "^1.0.0-alpha.0",
"@aws-sdk/util-hex-encoding": "1.0.0-gamma.1",
"@types/jest": "^25.1.4",
"jasmine-core": "^3.4.0",
"jest": "^25.1.0",
"karma": "^4.1.0",
"karma-chrome-launcher": "^3.0.0",
"karma-jasmine": "^3.1.1",
"karma-typescript": "^4.0.0",
"puppeteer": "^3.0.1",
"typescript": "~3.8.3"
},
"react-native": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("WebSocketHandler", () => {
expect(err.$metadata).toBeDefined();
expect(err.$metadata.httpStatusCode >= 500).toBe(true);
expect(
(global.setTimeout as jest.Mock).mock.calls.filter(args => {
((global as any).setTimeout as jest.Mock).mock.calls.filter(args => {
//find the 'setTimeout' call from the websocket handler
return args[0].toString().indexOf("$metadata") >= 0;
})[0][1]
Expand Down
Loading