forked from jestjs/jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple rAF polyfill in jsdom environment (jestjs#4568)
* Add simple rAF polyfill in jsdom environment Closes jestjs#4545 * Fix flow error * Tweak test * Try to log out stderr on CI * Use snake case naming for test file * Update to newest yarn on ci * Revert "Try to log out stderr on CI" This reverts commit 08d58c5. * Remove extra -- from appveyor to avoid warning on newer yarn * Include time since window initialised in rAF implementation
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 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
19 changes: 19 additions & 0 deletions
19
integration_tests/__tests__/request_animation_frame.test.js
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,19 @@ | ||
/** | ||
* Copyright (c) 2014-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. | ||
* | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
const runJest = require('../runJest'); | ||
|
||
test('requestAnimationFrame', () => { | ||
const result = runJest('request_animation_frame', ['--verbose']); | ||
const stderr = result.stderr.toString(); | ||
|
||
expect(stderr).toMatch('requestAnimationFrame test'); | ||
expect(result.status).toBe(0); | ||
}); |
21 changes: 21 additions & 0 deletions
21
integration_tests/request_animation_frame/__tests__/request_animation_frame.test.js
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,21 @@ | ||
/** | ||
* Copyright (c) 2014-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. | ||
*/ | ||
|
||
/* eslint-env browser */ | ||
|
||
'use strict'; | ||
|
||
test('requestAnimationFrame test', done => { | ||
expect.hasAssertions(); | ||
|
||
requestAnimationFrame(timestamp => { | ||
expect(true).toBe(true); | ||
expect(timestamp).toBeGreaterThan(0); | ||
|
||
done(); | ||
}); | ||
}); |
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 @@ | ||
{ | ||
"jest": { | ||
"testEnvironment": "jsdom" | ||
} | ||
} |
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