Karma base location

Unable to load templates for my tests using karma. To simplify

Went to c: \

Created a text file 1.txt.

Created a simple karama initialization file containing:

basePath: '',

Initial Karma Using:

C:\> karma start .\sample.conf.js

Chrome opened:

http://localhost:9876/?id=49209467

Then I tried to go to:

http://localhost:9876/base/1.txt

but received a "NOT FOUND" error message in the browser and a message from karma:

WARN [web-server]: 404: /base/1.txt

What am I missing here?

+4
source share
1 answer

Found answer:

By adding the following to the karma configuration file:

files: [ 
....
{ pattern: 'mocks/**/*.html', watched: true, served: true, included: false },
....

I managed to access the desired file by viewing

http://localhost:9876/base/mocks/file.html
+5
source

Source: https://habr.com/ru/post/1535714/


All Articles