Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/jest): Support chaining of jest function calls (#6747)
**Related issue:** - Closes #6540.
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": false, | ||
"dynamicImport": true, | ||
"decorators": true | ||
}, | ||
"transform": { | ||
"legacyDecorator": true, | ||
"hidden": { | ||
"jest": true | ||
} | ||
}, | ||
"target": "es2016", | ||
"loose": false, | ||
"externalHelpers": false, | ||
"keepClassNames": false | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import foo from "./foo"; | ||
|
||
jest.mock("./foo").mock("./bar"); | ||
|
||
test("Foo is a mock", () => { | ||
expect(jest.isMockFunction(foo)).toBe(true); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use strict"; | ||
jest.mock("./foo").mock("./bar"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default; | ||
const _foo = /*#__PURE__*/ _interopRequireDefault(require("./foo")); | ||
test("Foo is a mock", ()=>{ | ||
expect(jest.isMockFunction(_foo.default)).toBe(true); | ||
}); |
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