-
-
Notifications
You must be signed in to change notification settings - Fork 197
typescript unit test with import statement fails #4172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ochemerys it is possible that the Try craete a custom config file and remove the import * as chai from "chai";
export const assert: typeof chai.assert = (<any>global).chai.assert; like done here |
Thank you for your response, describe('Array', function () { but when I added there import statement: test fails again with the same error. so for me problem is not chai, but import statement itself Thank you. |
No need to import all modules as global ones - only the |
Sorry I was out of my place and was not able to test. I followed your instructions and still have the same issue: |
It is very easy to reproduce:
go to tests folder then run test
|
temporary workaround is here |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):-- tns doctor returns:
-- package file:
--- dependencies
Describe the bug
angular application typescript unit test with import statement fails with error:
ReferenceError: Can't find variable: exports
To Reproduce
and select mocha. Run test
Test runs successfully.
Test fails
Test is successful.
Test fails again with error:
The text was updated successfully, but these errors were encountered: