Questions tagged [Karma] (8)

0
answer

As in the karma config file to add the attribute to the script tag?

Or how is it possible to do? You need the script which is tested to set an attribute(whose value may be different), the script reads it.module.exports = function (config) { config.set({ basePath: ", frameworks: ['jasmine'], files: [ 'dist/main.js', 'dist/tests/main.spec.js' ], reporters: ['progress'], port: 9876, col...
Estell_Fritsch asked March 31st 20 at 21:44
0
answer

As for karma to do that would be after the tests, the browser is not closed?

Good afternoon, help to make what after the tests, the browser was not closed, as I want to see what's in the console. All guggi is to change three settings and each is different, but I never helped! My configuration file of karmamodule.exports = function (config) { config.set({ // base path that will be used to resolve a...
Alda_Pouros63 asked March 30th 20 at 00:19
0
answer

How to understand which test failed?

Karma gives Expected false to be truthy. ./src/app/modal/modal.service.spec.ts/</<@http://localhost:9876/_karma_webpack_/main.js:4026:78 ./node_modules/zone.js/dist/zone.js/</</ZoneDelegate.prototype.invoke@http://localhost:9876/_karma_webpack_/polyfills.js:2827:17 ./node_modules/zone.js/dist/zone-testing.js/<...
tamara9 asked March 15th 20 at 23:17
0
answer

How to use Jasmine to test SocketIO?

I can't find any reasonable documentation or examples of how to use Jasmine to test SocketIO? write tests for the examples, and they are not... Here is my socket service:import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import io from 'socket.io-cli...
sasha_Stehr85 asked March 13th 20 at 17:11
1
answer

Why when the tests are run on Angular2 the result is not displayed in the browser?

When I'm on a project zapusky "ng test" you see this The idea is that I would have to see something like this: The console shows that all the tests run successfully. karma.cong.jsmodule.exports = function (config) { config.set({ basePath: ", frameworks: ['jasmine', 'angular-cli'], plugins: [ require('karma-jasmine'), re...
Ford14 asked June 29th 19 at 14:19
1
answer

How to test the service?

Test :describe('Component: Login', function () { var ctrl; var $componentController; var $q; var $httpBackend; var _$rootScope; var $rest = {}; beforeEach(module('bcsgm.main')); beforeEach(inject(function (_$componentController_, _$q_, _$rootScope_, _$httpBackend_, _$rest_) { $componentController = _$componentCon...
Elyssa31 asked June 24th 19 at 11:51
0
answer

How to make tests saw pug (html) file?

There are pug page where you are canvas. You need to write a test that verifies work events with this canvas. In the test however, when you try to get the value of offsetWidth canvas element get the error undefined is not an object (evaluating 'Board.offsetWidth'). As I understand, this error means that the test is unaware ...
nikita.Stracke asked June 20th 19 at 12:38
0
answer

How to test GUI JavaScript in the browser from a console?

Dobrogo time. I have a long time sawing your project, wysiwyg editor Jodit. On the specifics it is clear that a lot of code interacts with the browser. The project is written in TypeScript, which collects webpack. From webpack in the settings:output: { path: path.join(__dirname, 'dist'), filename: 'jodit.js', publicPath...
marcelo_Cummings23 asked June 19th 19 at 12:52
1
answer

Why the project is necessary and Karma and Grunt?

There is a JavaScript library. I was given the assignment to cover it with tests. And said to use Grunt and Karma. I read the docks. It turns out that Grunt is the type of build system to run different jobs, and scripts; and Karma is a system to run the tests. That is, Grunt and Karma is a "zapuskalova". Can someone explai...
modesto_West asked June 8th 19 at 20:09
0
answer

How to fix karma-phantomjs-launcher" plugin: Path must be a string. Received null?

Trying to run karma, but get this error: ERROR [plugin]: Error during loading "C:\projects\sfa\devTools\js\node_modules/karma-phantomjs-launcher" plugin: Path must be a string. Received null Version node.js 8.10.0 Tried to manually put this karma-phantomjs-launcher npm install karma-phantomjs-launcher and npm install karma...
jaren_Thompson57 asked June 7th 19 at 11:07