-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug-13143-001 Added tests for function exports
- Loading branch information
1 parent
c36a196
commit 4f3f8db
Showing
4 changed files
with
56 additions
and
0 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
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,5 @@ | ||
export const f1 = () => { | ||
console.log("Im f1 calling f2"); | ||
f2(); | ||
}; | ||
export const f2 = () => console.log("Im f2"); |
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
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 * as m from './__fixtures__/index'; | ||
|
||
test('adds 1 + 2 to equal 3', () => { | ||
const spy = jest.spyOn(m, 'f2').mockImplementationOnce(jest.fn()); | ||
m.f2(); | ||
expect(spy).toHaveBeenCalled(); | ||
}); |