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

chore(deps-dev): bump jest to 26.x #497

Merged
merged 6 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.9.0",
"jest": "^21",
"jest": "^26",
"jsdoc": "^3.4.0",
"mkdirp": "^0.5.1"
},
Expand Down
15 changes: 7 additions & 8 deletions src/__tests__/Worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ const createTempFileWith = testUtils.createTempFileWith;
const getFileContent = testUtils.getFileContent;

describe('Worker API', () => {
let worker;

beforeEach(() => {
jest.resetModuleRegistry();
worker = require('../Worker');
});

it('transforms files', done => {
const worker = require('../Worker');
const transformPath =
createTransformWith('return fileInfo.source + " changed";');
const sourcePath = createTempFileWith('foo');
Expand All @@ -38,6 +32,7 @@ describe('Worker API', () => {
});

it('passes j as argument', done => {
const worker = require('../Worker');
const transformPath = createTempFileWith(
`module.exports = function (file, api) {
return api.j(file.source).toSource() + ' changed';
Expand Down Expand Up @@ -76,6 +71,7 @@ describe('Worker API', () => {
}

it('errors if new flow type code is parsed with babel v5', done => {
const worker = require('../Worker');
const transformPath = createTransformWith(
'api.jscodeshift(fileInfo.source); return "changed";'
);
Expand All @@ -92,6 +88,7 @@ describe('Worker API', () => {

['flow', 'babylon'].forEach(parser => {
it(`uses ${parser} if configured as such`, done => {
const worker = require('../Worker');
const transformPath = getTransformForParser(parser);
const sourcePath = getSourceFile();
const emitter = worker([transformPath]);
Expand All @@ -107,6 +104,7 @@ describe('Worker API', () => {

['babylon', 'flow', 'tsx'].forEach(parser => {
it(`can parse JSX with ${parser}`, done => {
const worker = require('../Worker');
const transformPath = getTransformForParser(parser);
const sourcePath = createTempFileWith(
'var component = <div>{foobar}</div>;'
Expand All @@ -122,7 +120,8 @@ describe('Worker API', () => {
});
});

it(`can parse enums with flow`, done => {
it('can parse enums with flow', done => {
const worker = require('../Worker');
const transformPath = getTransformForParser('flow');
const sourcePath = createTempFileWith(
'enum E {A, B}'
Expand Down
Loading