Skip to content

Commit 50a4d63

Browse files
committed
Add new test for APPLICATIONS.P1S
1 parent 7576810 commit 50a4d63

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ The returned promise resolves differently depending on the `GENERATION` on which
145145

146146
The promise will be rejected after 5 seconds if all expected decoys haven't been activated. Additionally, the library will attempt to undo any successful activations by sending another request to PL to deactivate decoys with the given key.
147147

148+
## Development
149+
150+
This repo uses tsdx for development and np for releases.
151+
152+
Everything you need should be in the npm scripts:
153+
154+
```bash
155+
npm start
156+
npm test
157+
npm run release
158+
```
159+
160+
Running tests requires some environment variables be set. The canonical version of these env vars are stored as secrets in GitHub, but if you need them to run tests locally, chat to one of the authors listed below.
161+
148162
## Authors
149163

150164
- Colin Gourlay ([[email protected]](mailto:[email protected]))
165+
- Simon Elvery ([[email protected]](mailto:[email protected]))

src/index.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,13 @@ describe('getApplication', () => {
7070
test('Phase 1 mobile', () => {
7171
document.head.innerHTML = '<meta name="HandheldFriendly" content="true"/>';
7272
expect(getApplication(false)).toBe(APPLICATIONS.P1M);
73+
document.head.innerHTML = '';
74+
});
75+
76+
test('Phase 1 standard', () => {
77+
const comment = document.createComment('COMMENT');
78+
document.insertBefore(comment, document.childNodes[1]);
79+
expect(getApplication(false)).toBe(APPLICATIONS.P1S);
80+
document.removeChild(comment);
7381
});
7482
});

0 commit comments

Comments
 (0)