mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-07 14:46:42 +00:00
Tests: explicitly share openpgp instance used in tests
Also, init config before any code is run in tests
This commit is contained in:
parent
d49d92e5cb
commit
ae4ed1fbf3
@ -96,6 +96,7 @@ module.exports = {
|
|||||||
// eslint-plugin-import rules:
|
// eslint-plugin-import rules:
|
||||||
'import/named': 'error',
|
'import/named': 'error',
|
||||||
'import/extensions': 'error',
|
'import/extensions': 'error',
|
||||||
|
'import/first': 'off',
|
||||||
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true, 'optionalDependencies': false, 'peerDependencies': false }],
|
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true, 'optionalDependencies': false, 'peerDependencies': false }],
|
||||||
'import/no-unassigned-import': 'error',
|
'import/no-unassigned-import': 'error',
|
||||||
'import/prefer-default-export': 'off',
|
'import/prefer-default-export': 'off',
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
|
||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
|
import openpgp from '../initOpenpgp.js';
|
||||||
import crypto from '../../src/crypto';
|
import crypto from '../../src/crypto';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
// Adapted from https://github.com/artjomb/cryptojs-extension/blob/8c61d159/test/eax.js
|
// Adapted from https://github.com/artjomb/cryptojs-extension/blob/8c61d159/test/eax.js
|
||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import EAX from '../../src/crypto/mode/eax.js';
|
import EAX from '../../src/crypto/mode/eax.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import OID from '../../src/type/oid.js';
|
import OID from '../../src/type/oid.js';
|
||||||
import KDFParams from '../../src/type/kdf_params.js';
|
import KDFParams from '../../src/type/kdf_params.js';
|
||||||
import * as elliptic_curves from '../../src/crypto/public_key/elliptic';
|
import * as elliptic_curves from '../../src/crypto/public_key/elliptic';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import * as elliptic_curves from '../../src/crypto/public_key/elliptic';
|
import * as elliptic_curves from '../../src/crypto/public_key/elliptic';
|
||||||
import hashMod from '../../src/crypto/hash';
|
import hashMod from '../../src/crypto/hash';
|
||||||
import config from '../../src/config';
|
import config from '../../src/config';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import crypto from '../../src/crypto';
|
import crypto from '../../src/crypto';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
// Adapted from https://github.com/artjomb/cryptojs-extension/blob/8c61d159/test/eax.js
|
// Adapted from https://github.com/artjomb/cryptojs-extension/blob/8c61d159/test/eax.js
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import OCB from '../../src/crypto/mode/ocb.js';
|
import OCB from '../../src/crypto/mode/ocb.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sandbox from 'sinon/lib/sinon/sandbox';
|
import sandbox from 'sinon/lib/sinon/sandbox';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import crypto from '../../src/crypto';
|
import crypto from '../../src/crypto';
|
||||||
import * as random from '../../src/crypto/random.js';
|
import * as random from '../../src/crypto/random.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import BN from 'bn.js';
|
import BN from 'bn.js';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
const armoredDSAKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
const armoredDSAKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
export default () => describe('ASCII armor', function() {
|
export default () => describe('ASCII armor', function() {
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
import BN from 'bn.js';
|
import BN from 'bn.js';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* globals tryTests */
|
/* globals tryTests */
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
import * as input from './testInputs.js';
|
import * as input from './testInputs.js';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
export default () => describe('Custom configuration', function() {
|
export default () => describe('Custom configuration', function() {
|
||||||
it('openpgp.readMessage', async function() {
|
it('openpgp.readMessage', async function() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
const password = 'I am a password';
|
const password = 'I am a password';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
export default () => describe('Elliptic Curve Cryptography for secp256k1 curve @lightweight', function () {
|
export default () => describe('Elliptic Curve Cryptography for secp256k1 curve @lightweight', function () {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
/* globals tryTests */
|
/* globals tryTests */
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
import { isAEADSupported, getPreferredAlgo } from '../../src/key';
|
import { isAEADSupported, getPreferredAlgo } from '../../src/key';
|
||||||
import KeyID from '../../src/type/keyid.js';
|
import KeyID from '../../src/type/keyid.js';
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
import spy from 'sinon/lib/sinon/spy';
|
import spy from 'sinon/lib/sinon/spy';
|
||||||
import * as stream from '@openpgp/web-stream-tools';
|
import * as stream from '@openpgp/web-stream-tools';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import crypto from '../../src/crypto';
|
import crypto from '../../src/crypto';
|
||||||
import * as random from '../../src/crypto/random.js';
|
import * as random from '../../src/crypto/random.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
import * as stream from '@openpgp/web-stream-tools';
|
import * as stream from '@openpgp/web-stream-tools';
|
||||||
import stub from 'sinon/lib/sinon/stub';
|
import stub from 'sinon/lib/sinon/stub';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import crypto from '../../src/crypto';
|
import crypto from '../../src/crypto';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
/* globals tryTests, loadStreamsPolyfill */
|
/* globals tryTests, loadStreamsPolyfill */
|
||||||
import * as stream from '@openpgp/web-stream-tools';
|
import * as stream from '@openpgp/web-stream-tools';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
import * as stream from '@openpgp/web-stream-tools';
|
import * as stream from '@openpgp/web-stream-tools';
|
||||||
import stub from 'sinon/lib/sinon/stub';
|
import stub from 'sinon/lib/sinon/stub';
|
||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import * as random from '../../src/crypto/random.js';
|
import * as random from '../../src/crypto/random.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
|
||||||
|
|
||||||
import nacl from '@openpgp/tweetnacl';
|
import nacl from '@openpgp/tweetnacl';
|
||||||
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
import * as elliptic from '../../src/crypto/public_key/elliptic';
|
import * as elliptic from '../../src/crypto/public_key/elliptic';
|
||||||
import * as signature from '../../src/crypto/signature';
|
import * as signature from '../../src/crypto/signature';
|
||||||
|
14
test/initOpenpgp.js
Normal file
14
test/initOpenpgp.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* This module centralises the openpgp import and ensures that the module is initialised
|
||||||
|
* at the top of the test bundle, and that the config is initialised before the tests code runs (incl. that outside of `describe`).
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as openpgp from 'openpgp';
|
||||||
|
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
window.openpgp = openpgp;
|
||||||
|
}
|
||||||
|
|
||||||
|
openpgp.config.s2kIterationCountByte = 0;
|
||||||
|
|
||||||
|
export default openpgp;
|
@ -1,8 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
import util from '../../src/util.js';
|
import util from '../../src/util.js';
|
||||||
|
|
||||||
const { readKey, readCleartextMessage, SignaturePacket } = openpgp;
|
const { readKey, readCleartextMessage, SignaturePacket } = openpgp;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
const armoredMessage = `-----BEGIN PGP MESSAGE-----
|
const armoredMessage = `-----BEGIN PGP MESSAGE-----
|
||||||
Version: OpenPGP.js VERSION
|
Version: OpenPGP.js VERSION
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
|
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
const { readKey, PublicKey, readCleartextMessage, createCleartextMessage, enums, PacketList, SignaturePacket } = openpgp;
|
const { readKey, PublicKey, readCleartextMessage, createCleartextMessage, enums, PacketList, SignaturePacket } = openpgp;
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { use as chaiUse, expect } from 'chai';
|
import { use as chaiUse, expect } from 'chai';
|
||||||
import chaiAsPromised from 'chai-as-promised';
|
import chaiAsPromised from 'chai-as-promised'; // eslint-disable-line import/newline-after-import
|
||||||
|
|
||||||
chaiUse(chaiAsPromised);
|
chaiUse(chaiAsPromised);
|
||||||
|
|
||||||
const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : await import('openpgp');
|
import openpgp from '../initOpenpgp.js';
|
||||||
|
|
||||||
const { readKey, PrivateKey, createMessage, enums, PacketList, SignaturePacket } = openpgp;
|
const { readKey, PrivateKey, createMessage, enums, PacketList, SignaturePacket } = openpgp;
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import * as openpgp from 'openpgp';
|
import openpgp from './initOpenpgp.js';
|
||||||
if (typeof window !== 'undefined' && !window.openpgp) { window.openpgp = openpgp }
|
|
||||||
|
|
||||||
|
|
||||||
(typeof window !== 'undefined' ? window : global).globalThis = (typeof window !== 'undefined' ? window : global);
|
(typeof window !== 'undefined' ? window : global).globalThis = (typeof window !== 'undefined' ? window : global);
|
||||||
|
|
||||||
@ -38,9 +36,6 @@ import runGeneralTests from './general';
|
|||||||
import runSecurityTests from './security';
|
import runSecurityTests from './security';
|
||||||
|
|
||||||
describe('Unit Tests', function () {
|
describe('Unit Tests', function () {
|
||||||
|
|
||||||
openpgp.config.s2kIterationCountByte = 0;
|
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
// Safari 14.1.*, 15.* and 16.* seem to have issues handling rejections when their native TransformStream implementation is involved,
|
// Safari 14.1.*, 15.* and 16.* seem to have issues handling rejections when their native TransformStream implementation is involved,
|
||||||
// so for now we ignore unhandled rejections for those browser versions.
|
// so for now we ignore unhandled rejections for those browser versions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user