简体   繁体   中英

How can an XML file be included into a mocha test case

I have written a test in mocha which is runned in karma. This test make use of some test xml data included in a separate file. The purpose of the test is to evaluate a parser. I have tried to include it using files in karma. But then I get an error "unexpected token <".

Got it to work, had left out "included: false" from {pattern: 'test/mock/description.xml', watched: false, served: true} which caused it to default to true. This lead to karma trying to including it in the html causing the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM