Skip to content

Commit

Permalink
Fixed tests and added browser targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ap3rtur3 committed Jun 14, 2019
1 parent b88c163 commit eb9b4e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"presets": [
[
"@babel/preset-env"
"@babel/preset-env",
{
"targets": {
"browsers": "last 2 versions, > 0.25%"
}
}
]
]
}
9 changes: 5 additions & 4 deletions src/event-registry.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const simulateClickEvent = (target) => {
view: window
}));
} else if (debug) {
throw Error('Cannot dispatch event on target in simulated click event')
throw Error('Cannot dispatch event on target in simulated click event');
}
};

Expand Down Expand Up @@ -145,13 +145,14 @@ describe('Event Registry', () => {
emit('event', val);
});

it('handles unique promises', async () => {
it('handles unique promises', () => {
const { wait, emit } = createEventRegistry({ uniqueEvents: true, debug });
const val = 42;
expect.assertions(1);
emit('event', val);
const result = await wait('event');
expect(result).toEqual(val);
wait('event').then(result => {
expect(result).toEqual(val);
});
});

//it('handles native promises', done => {
Expand Down

0 comments on commit eb9b4e2

Please sign in to comment.