Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillips committed May 1, 2018
1 parent 30ebfb5 commit 37b53c6
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 109 deletions.
17 changes: 17 additions & 0 deletions integration-tests/test-each/__tests__/each-exception.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

it.each`
left | right
${true} | ${true}
${true} |
`(
'throws exception when not enough arguments are supplied $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
);
39 changes: 39 additions & 0 deletions integration-tests/test-each/__tests__/each-only.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

it.only.each([[true, true], [true, true]])(
'passes one row expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.each([[true, false], [true, true]])(
'Should not be ran: fails all rows expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.only.each`
left | right
${true} | ${true}
${true} | ${true}
`('passes one row expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

it.each`
left | right
${true} | ${false}
${true} | ${false}
`(
'Should not be ran: fails all rows expected $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
);
39 changes: 39 additions & 0 deletions integration-tests/test-each/__tests__/each-skip.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

it.each([[true, true], [true, true]])(
'passes one row expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.skip.each([[true, false], [true, true]])(
'Should not be ran: fails all rows expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.each`
left | right
${true} | ${true}
${true} | ${true}
`('passes one row expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

it.skip.each`
left | right
${true} | ${false}
${true} | ${false}
`(
'Should not be ran: fails all rows expected $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
);
55 changes: 55 additions & 0 deletions integration-tests/test-each/__tests__/failure.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

it.each([[true, true], [true, false]])(
'fails one row expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.each([[true, false], [true, false]])(
'fails all rows expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

describe.each([[false, true], [true, false]])(
'fails all rows expected %s == %s',
(left, right) => {
it('fails', () => {
expect(left).toBe(right);
});
}
);

it.each`
left | right
${true} | ${false}
${true} | ${true}
`('fails one row expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

it.each`
left | right
${true} | ${false}
${true} | ${true}
`('fails all rows expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

describe.each`
left | right
${true} | ${false}
${false} | ${true}
`('fails all rows expected $left == $right', ({left, right}) => {
it('fails ', () => {
expect(left).toBe(right);
});
});
55 changes: 55 additions & 0 deletions integration-tests/test-each/__tests__/success.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

it.each([[true, true], [true, true]])(
'passes one row expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

it.each([[true, true], [true, true]])(
'passes all rows expected %s == %s',
(left, right) => {
expect(left).toBe(right);
}
);

describe.each([[true, true], [true, true]])(
'passes all rows expected %s == %s',
(left, right) => {
it('passes', () => {
expect(left).toBe(right);
});
}
);

it.each`
left | right
${true} | ${true}
${true} | ${true}
`('passes one row expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

it.each`
left | right
${true} | ${true}
${true} | ${true}
`('passes all rows expected $left == $right', ({left, right}) => {
expect(left).toBe(right);
});

describe.each`
left | right
${true} | ${true}
${true} | ${true}
`('passes all rows expected $left == $right', ({left, right}) => {
it('passes ', () => {
expect(left).toBe(right);
});
});
5 changes: 5 additions & 0 deletions integration-tests/test-each/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"jest": {
"testEnvironment": "node"
}
}
16 changes: 0 additions & 16 deletions packages/jest-jasmine2/src/__tests__/integration/each-only.test.js

This file was deleted.

16 changes: 0 additions & 16 deletions packages/jest-jasmine2/src/__tests__/integration/each-skip.test.js

This file was deleted.

77 changes: 0 additions & 77 deletions packages/jest-jasmine2/src/__tests__/integration/each.test.js

This file was deleted.

0 comments on commit 37b53c6

Please sign in to comment.