TestyTs
TestyTs copied to clipboard
Error: "jQuery is not defined"
In the project sgvizler2, I try to use TestyTs but my project use also JQuery.
I have the error:
ERROR An error occured while executing the following command: /usr/bin/node /home/karima/git/sgvizler2/node_modules/.bin/testyts. Error: "jQuery is not defined"
You can reproduce the error:
-
clone https://github.com/BorderCloud/sgvizler2.git
- remove the comments in the test "doParseOptionsRawWithoutOption" (file Chart.spec.ts)
-
testyts
May be, I forgot an option in testy.json ?
Thanks for reporting this, I'll take a look at it as soon as possible! :)
Hi @BorderCloud ! Thanks for your patience. I believe your issue could be solved by importing and defining jQuery in a test setup (new feature available in v1.3.0).
From the readme:
If you need to setup global stuff, you may do so by specifying a setup file in your testy.json.
testy.json
{ "setupFile": "test-setup.ts" }
test-setup.ts
// Import modules here, setup global variables, the whole nine yards global['foo'] = 'I can be used in test 😎';
Let ,me know if this works for you, Cheers!
With your example, I have the error : "error Command failed with exit code 1."