eslint-plugin-jest 21.27.1 → 21.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -182,6 +182,15 @@ ruleTester.run('valid-expect-in-promise', rule, {
|
|
|
182
182
|
],
|
|
183
183
|
|
|
184
184
|
valid: [
|
|
185
|
+
`
|
|
186
|
+
it('it1', () => new Promise((done) => {
|
|
187
|
+
test()
|
|
188
|
+
.then(() => {
|
|
189
|
+
expect(someThing).toEqual(true);
|
|
190
|
+
done();
|
|
191
|
+
});
|
|
192
|
+
}));
|
|
193
|
+
`,
|
|
185
194
|
`
|
|
186
195
|
it('it1', () => {
|
|
187
196
|
return somePromise.then(() => {
|
|
@@ -88,6 +88,7 @@ const getTestFunction = node => {
|
|
|
88
88
|
const isParentThenOrPromiseReturned = (node, testFunctionBody) => {
|
|
89
89
|
return (
|
|
90
90
|
testFunctionBody.type === 'CallExpression' ||
|
|
91
|
+
testFunctionBody.type === 'NewExpression' ||
|
|
91
92
|
node.parent.parent.type === 'ReturnStatement' ||
|
|
92
93
|
isPromiseReturnedLater(node, testFunctionBody) ||
|
|
93
94
|
isThenOrCatch(node.parent.parent)
|