Created
July 1, 2014 15:10
-
-
Save fkling/e954b3ecc79a3620df09 to your computer and use it in GitHub Desktop.
recast + jest-cli errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fkling@Felixs-iMac ~/D/p/es6-forof> jest | |
Using Jest CLI v0.1.16 | |
Found 1 matching tests... | |
FAIL __tests__/es6forof-test.js (0.166s) | |
Before parse | |
After parse | |
Before print | |
● es6-forof transform › it handles source | |
- Throws: AssertionError: false == true | |
1 tests failed, 0 tests passed (1 total) | |
Run time: 0.726s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
jest.autoMockOff(); | |
var transform = require('../'); | |
describe('es6-forof transform', function() { | |
it('handles source', function() { | |
var code = transform('console.log(1);'); | |
expect(function() { | |
eval(code); | |
}).not.toThrow(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var recast = require('recast'); | |
function es6_forof(source) { | |
console.log('Before parse'); | |
source = recast.parse(source); | |
console.log('After parse'); | |
console.log('Before print'); | |
source = recast.print(source).code; | |
console.log('After print'); | |
return source; | |
} | |
module.exports = es6_forof; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment