Skip to content

Commit

Permalink
Fix preconnect & preload tests in yarn start:demo (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
eligrey authored Oct 31, 2020
1 parent ccc89fe commit ea56879
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ const onReady = async (
},
],
[
'preconnect',
async (t) => {
'penumbra.preconnect()',
async () => {
const measurePreconnects = () =>
document.querySelectorAll('link[rel="preconnect"]').length;
const start = measurePreconnects();
Expand All @@ -283,13 +283,12 @@ const onReady = async (
});
const after = measurePreconnects();
cleanup();
t.assert(start < after);
t.end();
return start < after;
},
],
[
'preload',
async (t) => {
'penumbra.preload()',
async () => {
const measurePreloads = () =>
document.querySelectorAll('link[rel="preload"]').length;
const start = measurePreloads();
Expand All @@ -305,8 +304,7 @@ const onReady = async (
});
const after = measurePreloads();
cleanup();
t.assert(start < after);
t.end();
return start < after;
},
],
[
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@transcend-io/penumbra",
"version": "4.18.0",
"version": "4.18.1",
"description": "Crypto streams for the browser.",
"main": "build/penumbra.js",
"types": "ts-build/src/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/tests/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ test('penumbra.getTextOrURI(): including image in document', async (t) => {
t.end();
});

test('preconnect', async (t) => {
test('penumbra.preconnect()', async (t) => {
const measurePreconnects = () =>
document.querySelectorAll('link[rel="preconnect"]').length;
const start = measurePreconnects();
Expand All @@ -280,7 +280,7 @@ test('preconnect', async (t) => {
t.end();
});

test('preload', async (t) => {
test('penumbra.preload()', async (t) => {
const measurePreloads = () =>
document.querySelectorAll('link[rel="preload"]').length;
const start = measurePreloads();
Expand Down

0 comments on commit ea56879

Please sign in to comment.