Error in unit tests
See original GitHub issueAfter creating a project with this template, the tests don’t run:
$ npm test
> chatbot@1.1.0 test /project
> jest
FAIL tests/handler.test.js
● Test suite failed to run
/project/tests/handler.test.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import * as handler from '../handler';
^^^^^^
SyntaxError: Unexpected token import
at new Script (vm.js:51:7)
at Generator.next (<anonymous>)
at new Promise (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.531s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Unit Testing Error Handling and Exceptions
One of the things that unit tests are best for is checking error conditions. While we want wider coverage of full happy flows,...
Read more >How do you test that a Python function throws an exception?
The unittest function assertRaises only checks if an exception was raised. This seems overly complicated for testing if a function throws an exception....
Read more >Should unit tests check for error conditions?
Should a unit test incorporate tests for error conditions? For example, what if the database connection fails? Remember that the line by line...
Read more >Top 5 Mistakes You're Probably Making While Unit Testing ...
The key to unit testing is the word “unit”. First and foremost, your tests should be testing a unit of code. And what...
Read more >4 common mistakes when writing your first unit tests
4 common mistakes when writing your first unit tests · Mistake 1: Do not follow a naming convention · Mistake 2: Do not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I messed up the
.babelrc
file. Works fine now 😀This project looks promising, will try it out next time!
@jeff-kilbride I see. Thanks for reporting back.