Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read static files using Karma

Is is possible to read static JSON files in a Karma test? I would like to store the testdata in separate files.

I tried reading the files using require, but I didn't get that working.

like image 876
Remco Haszing Avatar asked Apr 12 '26 01:04

Remco Haszing


1 Answers

Try to use the requirejs's text plugin. It works perfectly well for this: https://github.com/requirejs/text

like image 131
Jeff Renaud Avatar answered Apr 13 '26 13:04

Jeff Renaud