Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
add jest tests and config (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkolson committed Nov 25, 2021
1 parent d160999 commit f9c9aac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions extension/advanzia-assistant.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './advanzia-assistant';
import { Script } from './advanzia-assistant';

describe('#ContentScript', () => {
it('should do something', async () => {
await new Promise((resolve) => {
new Script()
.on('done', () => resolve(void 0))
.execute();
});
});
});
1 change: 1 addition & 0 deletions extension/content-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ const script = new Script();

script
.on('done', () => console.log('done'))
.on('ready', () => console.log('ready'))
.on('error', (e) => console.log({ errors: script.errors, status: script.status }))
.execute();
5 changes: 5 additions & 0 deletions extension/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
};

0 comments on commit f9c9aac

Please sign in to comment.