Skip to content

Commit 294570a

Browse files
committed
fixex tests
1 parent 579c467 commit 294570a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"js",
7171
"json"
7272
],
73+
"setupFiles": ["<rootDir>/src/setupTests"],
7374
"testPathIgnorePatterns": [
7475
"<rootDir>/(lib|docs|node_modules)/"
7576
]

src/index.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import Adapter from 'enzyme-adapter-react-16';
44

55
import Currency from './index';
66

7+
global.requestAnimationFrame = function(callback) {
8+
setTimeout(callback, 0);
9+
};
10+
711
Enzyme.configure({ adapter: new Adapter() });
812

913
it('renders without crashing', () => {
@@ -13,7 +17,5 @@ it('renders without crashing', () => {
1317
/>
1418
);
1519

16-
console.log(wrapper.debug());
17-
1820
expect(wrapper.text()).toEqual('$89.00');
1921
});

src/setupTests.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
global.requestAnimationFrame = (callback) => {
2+
setTimeout(callback, 0);
3+
};

travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ sudo: false
22

33
language: node_js
44
node_js:
5-
- '8'
5+
- 7
66

77
cache:
88
directories:
99
- node_modules
1010

11-
# before_install:
12-
# - npm install codecov.io coveralls
11+
before_install:
12+
- npm install codecov.io coveralls
1313

1414
after_success:
1515
- cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js

0 commit comments

Comments
 (0)