Skip to content
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

Switch test runner to Jest #8

Closed
Glavin001 opened this issue Mar 10, 2018 · 7 comments
Closed

Switch test runner to Jest #8

Glavin001 opened this issue Mar 10, 2018 · 7 comments

Comments

@Glavin001
Copy link
Member

Glavin001 commented Mar 10, 2018

Jest: https://facebook.github.io/jest/

See https://github.com/Microsoft/vscode-extension-vscode/blob/master/lib/testrunner.js for how the Mocha test runner for VSCode is implemented.

@stevenzeck
Copy link
Contributor

Note: "Launch extension (vscode)" will open a new instance of VSCode with the testProject folder open, which you can manually beautify things. You have to manually stop the test or close the window.

@stevenzeck
Copy link
Contributor

stevenzeck commented Mar 29, 2018

I switched over to Jest. I keep getting cannot find module vscode errors in the src files.

node --nolazy -i --inspect-brk=18784 node_modules/.bin/jest --config jest.config.js --runInBand 
Debugger listening on ws://127.0.0.1:18784/0e7e6967-b73b-4ce7-b947-c4ef11ca541b
Debugger attached.
 FAIL  test/extension.test.ts
    Test suite failed to run
    Cannot find module 'vscode' from 'index.ts'
      1 | import * as vscode from "vscode";
      2 | import { Extension } from "./Extension";
    > 3 | import { EditProvider } from "./EditProvider";
      4 | import unibeautify from "unibeautify";
      5 | import { beautifiers } from "./beautifiers";
      6 | 
      
      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:169:17)
      at Object.<anonymous> (src/index.ts:3:66)
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        4.806s
Ran all test suites.
Waiting for the debugger to disconnect...

@stevenzeck
Copy link
Contributor

Anyone wants to take a shot at it: https://github.com/szeck87/vscode/tree/migrate-to-jest

@Glavin001
Copy link
Member Author

I will try later. For now I want to get #10 working 👍 .

@stevenzeck
Copy link
Contributor

@stevenzeck
Copy link
Contributor

It's kind of ugly, but it works: https://github.com/szeck87/vscode/tree/migrate-to-jest

@Glavin001
Copy link
Member Author

See #19

@Glavin001 Glavin001 added this to the Next Release milestone Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants