Skip to content

Commit 93c828c

Browse files
committed
chore: 🤖 fix karma tests
1 parent f0d651a commit 93c828c

File tree

4 files changed

+341
-762
lines changed

4 files changed

+341
-762
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"jest": "29.7.0",
7171
"jest-preset-angular": "14.6.0",
7272
"jsdom": "^25.0.1",
73-
"karma": "6.4.2",
73+
"karma": "6.4.4",
7474
"karma-chrome-launcher": "3.2.0",
7575
"karma-coverage-istanbul-reporter": "3.0.3",
7676
"karma-jasmine": "5.1.0",

projects/spectator/karma.conf.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
// tslint:disable
2-
31
// Karma configuration file, see link for more information
42
// https://karma-runner.github.io/1.0/config/configuration-file.html
53

64
const build = process.env.NODE_ENV === 'build';
75

8-
module.exports = function(config) {
6+
module.exports = function (config) {
97
config.set({
10-
basePath: "",
11-
frameworks: ["jasmine", "@angular-devkit/build-angular"],
8+
basePath: '',
9+
frameworks: ['jasmine'],
1210
plugins: [
13-
require("karma-jasmine"),
14-
require("karma-chrome-launcher"),
15-
require("karma-jasmine-html-reporter"),
16-
require("karma-coverage-istanbul-reporter"),
17-
require("@angular-devkit/build-angular/plugins/karma"),
11+
require('karma-jasmine'),
12+
require('karma-chrome-launcher'),
13+
require('karma-jasmine-html-reporter'),
14+
require('karma-coverage-istanbul-reporter'),
1815
],
1916
client: {
2017
clearContext: false, // leave Jasmine Spec Runner output visible in browser
2118
},
2219
coverageIstanbulReporter: {
23-
dir: require("path").join(__dirname, "../../coverage/spectator"),
24-
reports: ["html", "lcovonly"],
20+
dir: require('path').join(__dirname, '../../coverage/spectator'),
21+
reports: ['html', 'lcovonly'],
2522
fixWebpackSourcePaths: true,
2623
},
27-
reporters: ["progress", "kjhtml"],
24+
reporters: ['progress', 'kjhtml'],
2825
port: 9876,
2926
colors: true,
3027
logLevel: config.LOG_INFO,

projects/spectator/test/hello/hello.component.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { createHostFactory, SpectatorHost } from '@ngneat/spectator';
22

33
import { HelloComponent } from './hello.component';
4+
import { TranslateService } from '../translate.service';
5+
import { TranslatePipe } from '../translate.pipe';
46

57
describe('HelloComponent', () => {
68
let host: SpectatorHost<HelloComponent>;
79

8-
const createHost = createHostFactory(HelloComponent);
10+
const createHost = createHostFactory({
11+
component: HelloComponent,
12+
declarations: [TranslatePipe],
13+
providers: [TranslateService],
14+
});
915

1016
it('should display the title', () => {
1117
host = createHost(`<hello [title]="title" [widthRaw]="widthRaw"></hello>`, {

0 commit comments

Comments
 (0)