Skip to content

Commit

Permalink
Revert "test: skip process crashing tests on electron@15"
Browse files Browse the repository at this point in the history
This reverts commit 137c473.
  • Loading branch information
panva committed Oct 3, 2021
1 parent a34bdab commit 4128c16
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 60 deletions.
17 changes: 3 additions & 14 deletions test/jwe/smoke.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -298,26 +298,15 @@ Promise.all([
run = run.failing;
}

if ('electron' in process.versions) {
switch (electron) {
case 0:
run = run.failing;
break;
case parseInt(process.versions.electron, 10) >= 15 && 2:
run = run.skip;
break;
case 2:
run = run.failing;
break;
}
if (!electron && 'electron' in process.versions) {
run = run.failing;
}

return run;
}

conditional({ webcrypto: 0 }, smoke, 'rsa1_5');
conditional({ webcrypto: 0, electron: 0 }, smoke, 'x25519');
conditional({ webcrypto: 0, electron: 2 }, smoke, 'x448');
conditional({ webcrypto: 0, electron: 0 }, smoke, 'x448');
conditional({ webcrypto: 0 }, 'as keyobject', smoke, 'oct256c', undefined, undefined, true);
conditional({ webcrypto: 0 }, 'as keyobject', smoke, 'oct384c', undefined, undefined, true);
conditional({ webcrypto: 0 }, 'as keyobject', smoke, 'oct512c', undefined, undefined, true);
Expand Down
19 changes: 4 additions & 15 deletions test/jwk/jwk2key.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,9 @@ Promise.all([import(`${keyRoot}/key/import`), import(`${keyRoot}/key/export`)]).
run = run.failing;
}

if ('electron' in process.versions) {
switch (electron) {
case 0:
run = run.failing;
break;
case parseInt(process.versions.electron, 10) >= 15 && 2:
run = run.skip;
break;
case 2:
run = run.failing;
break;
}
if (!electron && 'electron' in process.versions) {
run = run.failing;
}

return run;
}

Expand Down Expand Up @@ -262,7 +251,7 @@ Promise.all([import(`${keyRoot}/key/import`), import(`${keyRoot}/key/export`)]).
d: 'UhC3-vN5vp_g9PnTknXZgfXUez7Xvw-OfuJ0pYkuwzpYkcTvacqoFkV_O05WMHpyXkzH9q2wzx5n',
kty: 'OKP',
};
conditional({ webcrypto: 1, electron: 2 })(testKeyImportExport, { ...ed448, alg: 'EdDSA' });
conditional({ webcrypto: 1, electron: 0 })(testKeyImportExport, { ...ed448, alg: 'EdDSA' });
const x25519 = {
crv: 'X25519',
x: 'axR8Q7PEd74nY9nWaAoAYpMe3gp5sWbau6V6X1inPw4',
Expand All @@ -276,7 +265,7 @@ Promise.all([import(`${keyRoot}/key/import`), import(`${keyRoot}/key/export`)]).
d: 'xBrCwLlrHa1ov2cbmD4eMw4t6DoN_MWsBT_mxcA_QWsCS_9sKMRyFpphNN9_2iKrGPTC9pWCS5w',
kty: 'OKP',
};
conditional({ webcrypto: 0, electron: 2 })(testKeyImportExport, { ...x448, alg: 'ECDH-ES' });
conditional({ webcrypto: 0, electron: 0 })(testKeyImportExport, { ...x448, alg: 'ECDH-ES' });
},
(err) => {
test('failed to import', (t) => {
Expand Down
17 changes: 3 additions & 14 deletions test/jws/smoke.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -212,26 +212,15 @@ Promise.all([
run = run.failing;
}

if ('electron' in process.versions) {
switch (electron) {
case 0:
run = run.failing;
break;
case parseInt(process.versions.electron, 10) >= 15 && 2:
run = run.skip;
break;
case 2:
run = run.failing;
break;
}
if (!electron && 'electron' in process.versions) {
run = run.failing;
}

return run;
}

conditional({ webcrypto: 0, electron: 0 })(smoke, 'secp256k1');
conditional({ webcrypto: 1 })(smoke, 'ed25519');
conditional({ webcrypto: 1, electron: 2 })(smoke, 'ed448');
conditional({ webcrypto: 1, electron: 0 })(smoke, 'ed448');
},
(err) => {
test('failed to import', (t) => {
Expand Down
23 changes: 6 additions & 17 deletions test/key/importexport.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,9 @@ function conditional({ webcrypto = 1, electron = 1 } = {}) {
run = run.failing;
}

if ('electron' in process.versions) {
switch (electron) {
case 0:
run = run.failing;
break;
case parseInt(process.versions.electron, 10) >= 15 && 2:
run = run.skip;
break;
case 2:
run = run.failing;
break;
}
if (!electron && 'electron' in process.versions) {
run = run.failing;
}

return run;
}

Expand Down Expand Up @@ -190,13 +179,13 @@ Promise.all([import(`${keyRoot}/key/import`), import(`${keyRoot}/key/export`)]).
for (const alg of ['EdDSA']) {
test(`import SPKI ed25519 for ${alg}`, testSPKI, keys.ed25519.publicKey, alg);
test(`import PKCS8 ed25519 for ${alg}`, testPKCS8, keys.ed25519.privateKey, alg);
conditional({ webcrypto: 1, electron: 2 })(
conditional({ webcrypto: 1, electron: 0 })(
`import SPKI ed448 for ${alg}`,
testSPKI,
keys.ed448.publicKey,
alg,
);
conditional({ webcrypto: 1, electron: 2 })(
conditional({ webcrypto: 1, electron: 0 })(
`import PKCS8 ed448 for ${alg}`,
testPKCS8,
keys.ed448.privateKey,
Expand All @@ -217,13 +206,13 @@ Promise.all([import(`${keyRoot}/key/import`), import(`${keyRoot}/key/export`)]).
keys.x25519.privateKey,
alg,
);
conditional({ webcrypto: 0, electron: 2 })(
conditional({ webcrypto: 0, electron: 0 })(
`import SPKI x448 for ${alg}`,
testSPKI,
keys.x448.publicKey,
alg,
);
conditional({ webcrypto: 0, electron: 2 })(
conditional({ webcrypto: 0, electron: 0 })(
`import PKCS8 x448 for ${alg}`,
testPKCS8,
keys.x448.privateKey,
Expand Down

0 comments on commit 4128c16

Please sign in to comment.