typescript - Unexpected reserved word error while testing using wallaby -


in test file have written test cases, have imported typescript file below:

import {rootreducer} "../src/reducers/rootreducer"; 

in rootreducer.ts have imported typescript file below:

import taskreducer "./taskreducer.ts"; 

then shows error:

syntaxerror: unexpected reserved word @ src/reducers/rootreducer.ts:7 

both rootreducer.ts , taskreducer.ts come under folder /src/reducers

no failing tests if remove '.ts' import statement, throws error in browser. app won't run then

the wallaby configuration below:

module.exports = function (wallaby) {      return {         files: [             'src/*.ts',             'src/**/*.ts'         ],          tests: [             'test/*test.ts'         ],          testframework: "mocha",          env: {             type: 'node'         },          compilers: {             '**/*.ts': wallaby.compilers.typescript({                 /* 1 commonjs*/                 module: 1             })         }     } }; 

your statement:

import taskreducer "./taskreducer.ts"; 

should either be:

// import taskreducer module import {taskreducer} "./taskreducer"; 

or:

// import whole module , call taskreducer import * taskreducer "./taskreducer"; 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -