Comments (10)
No need to fix it for me or anything, but just a heads up.
from jest-codemods.
It turns it fails even without the promise
import test from 'ava'
test('should pass', t => {
shouldFail(t, 'hi')
})
function shouldFail(t, message) {
t.same('error', message)
}
from jest-codemods.
Thank you so much for sharing the code examples here. I'll look into a fix.
Did it work for you on the rest of the codebase?
from jest-codemods.
There were some issues, so like the default paths don't work. The only seem to work when I type them from the command line.
jest-codemods public/js/**/__tests__/*.js
works
jest-codesmods
without a path does not work (even if I type the path during the command step). It just says it can't find any of my files.
I assume that's something to do with how you process paths vs. how the OS does it for you. Anyway, not a big deal.
Also had some issues installing globally, so i was just running it locally from ./node_modules/.bin/jest-codemods
So far so good, not all the tests that transpiled are passing, but it's helping a lot
from jest-codemods.
Thank you for sharing, I really appreciate it! : )
Based on your example I found some issues with how t properties were parsed. It should now be more stable now. And also handle AVA t.same
and other deprecated AVA properties that I overlooked. fd5e
Can you give 0.2.4 a spin?
As for the problem with global installment, which version did you try? Maybe you can try out 0.2.4 and see if you have the same problem.
Thanks!
from jest-codemods.
Version 0.2.5 should fix your issue with globs not working when not providing a path.
from jest-codemods.
awesome! trying them now
On Fri, Sep 30, 2016 at 4:23 PM, Kenneth Skovhus [email protected]
wrote:
Version 0.2.5 should fix your issue with globs not working when not
providing a path.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#8 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAPBf2j23yoP5W5UjhlAkQw8NKx7ezK-ks5qvZoFgaJpZM4KLacR
.
from jest-codemods.
There is still some issues with not removing t
for the case where you are passing it to a function.
Example:
import test from 'ava'
test('should pass', t => {
shouldFail(t, 'hi')
return shouldFail2(t, 'hi')
})
function shouldFail(t, message) {
t.same('error', message)
}
function shouldFail2(t, message) {
return Promise.reject().catch(err => {
t.same(err.message, message)
})
}
Currently converts to
it('should pass', () => {
shouldFail(t, 'hi')
return shouldFail2(t, 'hi')
})
function shouldFail(t, message) {
expect('error').toEqual(message)
}
function shouldFail2(t, message) {
return Promise.reject().catch(err => {
expect(err.message).toEqual(message)
})
}
Notice that t
is undefined. It should either be removed or replaced with Jasmines done
function.
from jest-codemods.
cool, this is more than enough to get us started thanks!
from jest-codemods.
@xjamundx let me know if you find other bugs. : )
from jest-codemods.
Related Issues (20)
- jasmine-globals: Suggest relaxing matching for spyOn(..).and.xx(..) HOT 1
- Feature Suggestion: Command Line Options for Prompts HOT 1
- Chai: `not.to.include` erroneously transformed to `toEqual(expect.arrayContaining...)` HOT 2
- doesn't convert chai `to.be.equalTo` to jest `toEqual` HOT 3
- TypeError: babel.loadOptionsSync is not a function HOT 3
- Ava: test.failing should be changed to test.skip HOT 2
- Feature Suggestion: Migration from outdated versions of Jest HOT 4
- Dependency Dashboard
- Version 0.26.2 is unrunnable due to esm-only globby HOT 2
- Sinon transformer doesn't seem to recognize sinon usages HOT 2
- convert jasmine clock methods to jest
- Sinon transformer doesn't support cjs HOT 4
- Why test migration skipped?
- Feature request to migrate from intern
- Is Sinon actually incompatible with Jest?
- Does not support Typescript `satisfies` keyword HOT 2
- Typescript: function (this) is incorrectly transformed HOT 1
- `jasmine-globals`: support for `jest.setSystemTime()`
- `jest-globals-import`: false negative when global is explicitly imported
- `jasmine-globals`: async `SpyStrategy` methods are not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-codemods.