Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasso committed Jul 6, 2016
1 parent 37fb17d commit d626b31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"babel-plugin-transform-es3-member-expression-literals": "6.8.0",
"babel-plugin-transform-es3-property-literals": "6.8.0",
"babel-plugin-transform-object-rest-spread": "6.8.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.3.13",
"babel-preset-es2015": "6.5.0",
"babel-preset-stage-0": "6.5.0",
"babel-register": "6.9.0",
Expand Down
12 changes: 10 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ describe('Refraction', () => {
global.performance = {};
refraction.addToHistory('testChannel', { value: 'foo' });
const history = refraction.getHistory();
expect(history[history.length - 1]).toMatch({
if (history[history.length - 1].time) {
expect(history[history.length - 1].time).toMatch(/\d+.\d{0,}/);
}
delete history[history.length - 1].time;
expect(history[history.length - 1]).toEqual({
channel: 'testChannel',
param: {
value: 'foo',
Expand Down Expand Up @@ -113,7 +117,11 @@ describe('Refraction', () => {
refraction.addToHistory('testChannel', { value: 'foo' });
const history = refraction.getHistory();
expect(Array.isArray(history)).toEqual(true);
expect(history[0]).toMatch({
if (history[0].time) {
expect(history[0].time).toMatch(/\d+.\d{0,}/);
}
delete history[0].time;
expect(history[0]).toEqual({
channel: 'testChannel',
param: {
value: 'foo',
Expand Down

0 comments on commit d626b31

Please sign in to comment.