Skip to content

Commit

Permalink
karma still not working, but i have found that issue codymikol/karma-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Santalov committed Jun 14, 2022
1 parent 4317c02 commit 3bc74c5
Show file tree
Hide file tree
Showing 4 changed files with 800 additions and 73 deletions.
57 changes: 28 additions & 29 deletions packages/rxjs-websocket/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ module.exports = function (config) {

// frameworks to use
// available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
frameworks: ['jasmine'],
frameworks: ['jasmine', 'webpack'],

plugins: [
'karma-webpack',
'karma-jasmine',
'karma-chrome-launcher',
'karma-jasmine-html-reporter'
],


// list of files / patterns to load in the browser
files: [
'src/**/*.spec.ts',
{
pattern: 'src/**/*.spec.ts',
watched: false,
},
],


Expand All @@ -26,40 +36,29 @@ module.exports = function (config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
preprocessors: {
'**/*.ts': ['typescript']
'src/**/*.spec.ts': ['webpack']
},

// https://www.npmjs.com/package/karma-typescript-preprocessor
typescriptPreprocessor: {
// copy of the tsconfig
options: {
"baseUrl": "./",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2020",
"dom"
]
// https://gist.github.com/cevek/d64f864ad6677a7f7e46915670a14664
webpack: {
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter
reporters: ['progress', 'kjhtml'],
reporters: ['progress'],


// web server port
Expand All @@ -76,7 +75,7 @@ module.exports = function (config) {


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


// start these browsers
Expand Down
7 changes: 5 additions & 2 deletions packages/rxjs-websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
"karma-chrome-launcher": "^3.1.0",
"karma-jasmine": "^4.0.1",
"karma-jasmine-html-reporter": "^2.0.0",
"karma-typescript-preprocessor": "^0.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^5.0.0",
"rxjs": "~7.5.0",
"typescript": "^4.6.2"
"ts-loader": "^9.3.0",
"typescript": "^4.6.2",
"webpack": "^5.73.0"
},
"peerDependencies": {
"rxjs": "~7.5.0"
Expand Down
11 changes: 0 additions & 11 deletions packages/rxjs-websocket/src/test.ts

This file was deleted.

Loading

0 comments on commit 3bc74c5

Please sign in to comment.