-
Notifications
You must be signed in to change notification settings - Fork 0
Look into code coverage #19
Comments
This might help. https://github.com/keplersj/atom-test-runner-jest |
@keplersj Cleaned up the list, looks like yours isn't (yet?) published on NPM though. Somebody else also built a Jest runner, but their build is failing so I have no idea how usable it is lol. |
It's live. I've used it for language-crystal to simply the tokenization tests with snapshots. https://github.com/crystal-lang-tools/language-crystal |
As per AtomLinter/Meta#19, it would be ideal to have a test runner with code coverage capabilities. This is a first try at getting Mocha or Jest running inside the Atom environment. This commit has a working installation of mocha, with test showing the atom globals are found showed as passing in the Atom Spec Runner Window. Jest is not working at this time. Jest will run inside Atom and try to test the file, but fails to inject the Jest global variables, such as `test` and `expect`.
As per AtomLinter/Meta#19, it would be ideal to have a test runner with code coverage capabilities. This is a first try at getting Mocha or Jest running inside the Atom environment. This commit has a working installation of mocha, with test showing the atom globals are found showed as passing in the Atom Spec Runner Window. Jest is not working at this time. Jest will run inside Atom and try to test the file, but fails to inject the Jest global variables, such as `test` and `expect`.
atom-jasmine3-test-runner lets you write new tests in Jasmine 3.x while keeping old tests in Jasmine 1.3 while transitioning. |
If anyone's looking for an example of code coverage in an Atom package, look no further than |
How do you run the tests on linter-swiftlint? When I try to run |
Hmmmm, |
|
do the |
Not when using |
What am I doing wrong?
C:\Users\tjbrix\Documents\projects\GitHub\linter-swiftlint>npm test
> linter-swiftlint@1.3.1 test C:\Users\tjbrix\Documents\projects\GitHub\linter-swiftlint
> atom --test spec
No tests found
In C:\Users\tjbrix\Documents\projects\GitHub\linter-swiftlint
9 files checked.
testMatch: **/__tests__/**/*.(js|jsx|json|node|ts|tsx|coffee|litcoffee|coffee.md),**/?(*.)(spec|test).(js|jsx|json|node|ts|tsx|coffee|litcoffee|coffee.md),**/spec/**/*-spec.(js|jsx|json|node|ts|tsx|coffee|litcoffee|coffee.md) - 1 match
testPathIgnorePatterns: \\node_modules\\ - 9 matches
Pattern: C:\Users\tjbrix\Documents\projects\GitHub\linter-swiftlint\spec - 0 matches |
Guess I'll have to break out the Windows and do some debugging. My first guess is that I'm doing something in |
Seems to be something with Windows. I setup an Ubuntu VM and did the same steps and everything worked. |
@UziTech I've just replicated your issue. Investigating further. |
@UziTech I think I've found a potential solution. Going to verify it doesn't break macOS and Linux. |
@UziTech Fixed in |
it works 🎉 |
Code Coverage
The Jasmine 1.3 based test framework built into Atom that most packages use is not only quite out of date, but doesn't support generating code coverage support of a package.
An alternative test framework that supports generating code coverage reports should be looked into.
Atom supports running custom test runners with the
atomTestRunner
key inpackage.json
. This was introduced in atom/atom#8968, although it looks like the functionality may have changed from what is documented there.Potential frameworks
Mocha
atom-mocha-test-runner
Example usage can be found in the atom/github repo (note, tagged link, check for newer version later).
Jest
atom-test-runner-jest
atom-jest-test-runner
The build for this is failing currently, not exactly a good sign for it's usability.
The text was updated successfully, but these errors were encountered: