Questions tagged [jasmine-node]
Integration of Jasmine Spec framework with Node.js
jasmine-node
326
questions
0
votes
0
answers
54
views
No specs are being found in jasmine options file
I have a jasmine.options.js file and have defined some suites inside
module.exports = {
suites: {
first: [
'../**/*.spec.js',
],
second: [
'../anotherpath/**/*.spec....
2
votes
0
answers
362
views
"Error [ERR_MODULE_NOT_FOUND]: Cannot find module when running Jasmine tests"
I'm facing an issue while running Jasmine tests for my project. When I execute the command jasmine in my project directory, I encounter the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find ...
4
votes
1
answer
2k
views
Ng new doesnt have Karma
Whenever I try to create a new project the karma.conf.js is always missing. Is there a reason why
I expected to have karma.conf.js and all the other stuff but I cant seem to find any of it
Project ...
0
votes
1
answer
28
views
In a jasmine-node mock method, why is ".and" undefined?
I'm running jasmine-node 3.0.0. When I run the following spec, jasmine reports "TypeError: Cannot read properties of undefined (reading 'returnValue')". Why? Do spy objects in jasmine-node ...
0
votes
1
answer
95
views
How can I test a function that use a promise?
how can I test a function that call a promise ?
click() {
this.todoService.getUsers().then(
(resp) => {
this.users = resp;
},
(reject) => {
console.log(...
0
votes
1
answer
2k
views
error TS2552: Cannot find name 'xdescribe'. Did you mean 'describe'?
I am working on unit testing in angular application. And I have skipped some test suites by using xdescrie. Unfortunately, it is showing errors like error TS2552: Cannot find name 'xdescribe'. Did you ...
0
votes
1
answer
389
views
How to match Jasmine's 'toHavenBeenCalledWith()' with a multiline literal string
I have a method that takes a script written in a multiline literal String, and which I call in several other methods. It looks something like:
myMethod(`
thisIsMyScript();
itDoesThings(...
0
votes
1
answer
2k
views
How to make a jasmine test of .pipe(catchError(this.handleError('get' + this.apiName, [])));
I am testing this service:
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { ...
-1
votes
1
answer
901
views
how to write unit test for behavior subject
@Input() public openDrawer: BehaviorSubject<{
open: boolean;
assetConditionDetails: AssetConditionIdDetails[];
selectedAssets: SelectedAssets[];
}>;
public ngOnInit(): void {
...
1
vote
1
answer
2k
views
Failed: Invalid provider for the NgModule 'DynamicTestModule' - only instances of Provider and Type are allowed, got: [[object Object]?]
So there's this delightful error that's the very definition of annoying
this is the describe method:
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MapMap ],
imports: ...
0
votes
1
answer
596
views
TypeScript module testing with Jasmine
I have the following structure :
src folder with file1.ts
spec folder(same level as src - siblings) with file1.spec.ts
I try to run typescript Jasmine tests
file1.ts looks like this :
export module ...
0
votes
1
answer
286
views
How to unit test a non-module with jasmine-node? (related to turning off node integration in Electron)
I have a bit of a dilemma.
I turned on contextIsolation and turned off nodeIntegration for my BrowserWindow and loaded a local html page. (as is recommended by Electron).
This local html page requires ...
0
votes
2
answers
857
views
Protractor - Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
My Protractor test fails with below error
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
This is my spec file.
let common=require('./...
0
votes
0
answers
88
views
Jasmine - How to get only specs within current suite?
I have multiple suites(describes) inside a spec.js file. I would like to implement jasmine-fail-fast and fail only one suite(single describe block) at a time and proceed with the rest in the spec.js ...
1
vote
0
answers
25
views
How to do an async process in jasmine?
Hi guys im new to jasmine and I am currently running some tests. I am not sure if what im doing the correct thing but I the thing is I want to fetch a data first from an api. And then I will loop ...