Skip to content

Commit

Permalink
fix node tests and close to finish karma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rstp-god committed Oct 18, 2022
1 parent 5f6c0ad commit 8be5c20
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ node_js:
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
before_install:
- yarn cache clean
install:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"packages/*"
],
"useWorkspaces": true,
"version": "2.4.5"
"version": "6.0.0"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
},
"workspaces": {
"packages": [
"examples/*",
"packages/*"
],
"examples": [
"examples/*"
],
"nohoist": [
"**/react-native",
"**/react-native/**",
Expand Down
13 changes: 13 additions & 0 deletions packages/e3kit-browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,21 @@ const createEntry = (target, cryptoType, format) => {
},
}),
wasm({
publicPath: outputPath,
sync: [foundationWasmPath, pythiaWasmPath],
}),
copy({
targets: [
{
src: foundationWasmPath,
dest: outputPath,
},
{
src: pythiaWasmPath,
dest: outputPath,
},
],
}),
],
};
};
Expand Down
4 changes: 0 additions & 4 deletions packages/e3kit-browser/src/EThree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export class EThree extends AbstractEThree {
const onFinishCallback = () =>
resolve(streamSigner.sign(privateKey as VirgilPrivateKey));

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const onErrorCallback = (err: any) => {
streamSigner.dispose();
reject(err);
Expand Down Expand Up @@ -702,13 +701,10 @@ export class EThree extends AbstractEThree {
retryOnUnauthorized: true,
apiUrl: opts.apiUrl,
productInfo: {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
product: process.env.__VIRGIL_PRODUCT_NAME__!,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
version: process.env.__VIRGIL_PRODUCT_VERSION__!,
},
});
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const groupStorageLeveldown = leveljs(opts.groupStorageName!);

return {
Expand Down
1 change: 0 additions & 1 deletion packages/e3kit-browser/src/processFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type processFileOptions = {
signal?: AbortSignal;
onChunkCallback: onChunkCallback;
onFinishCallback: () => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onErrorCallback: (err: any) => void;
};

Expand Down
1 change: 0 additions & 1 deletion packages/e3kit-browser/src/typeguards.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const isFile = (val: any): val is File => {
return val instanceof File;
};
2 changes: 1 addition & 1 deletion packages/e3kit-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/types",
"outDir": "./dist",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": false,
Expand Down
6 changes: 3 additions & 3 deletions packages/e3kit-tests/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ dotenv.config();
module.exports = (config) => {
config.set({
frameworks: ['mocha'],
autoWatch: false,
autoWatch: true,
files: ['src/browser.test.ts'],
browsers: ['ChromeHeadless'],
colors: true,
logLevel: config.LOG_INFO,
browserNoActivityTimeout: 60 * 1000,
singleRun: true,
singleRun: false,
mime: {
'text/x-typescript': ['ts'],
'application/wasm': ['wasm'],
Expand All @@ -27,7 +27,7 @@ module.exports = (config) => {
},
reporters: ['spec'],
webpack: {
mode: 'production',
mode: process.env.NODE_ENV || JSON.stringify('production'),
resolve: {
extensions: ['.js', '.ts'],
},
Expand Down
6 changes: 2 additions & 4 deletions packages/e3kit-tests/src/browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import './common/EThree.spec';
import './common/Group.spec';
import './browser/EThreeBrowser.test';
import './browser/EthreeDocSnippets.test';
import './browser/EThreeBrowser.spec';
import './browser/EthreeDocSnippets.spec';
4 changes: 2 additions & 2 deletions packages/e3kit-tests/src/common/EThree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe('EThree', () => {
const fetchToken = createFetchToken(identity);
const sdk = await initializeEThree(fetchToken);
try {
await sdk.lookupPublicKeys([identity, identity, 'random']);
await sdk.findUsers([identity, identity, 'random']);
} catch (e) {
expect(e).to.be.instanceOf(Error);
return;
Expand Down Expand Up @@ -797,7 +797,7 @@ describe('EThree', () => {
const recipient = virgilCrypto.generateKeys();
const sdk = await initializeEThree(fetchToken);
await sdk.register();
const publicKey = (await sdk.lookupPublicKeys([identity]))[0];
const publicKey = (await sdk.findUsers([identity]))[0];
const encryptedMessage = await sdk.encrypt(buf, recipient.publicKey);
expect(isBuffer(encryptedMessage)).to.be.true;
const resp = await sdk.decrypt(encryptedMessage, publicKey);
Expand Down
4 changes: 2 additions & 2 deletions packages/e3kit-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"compilerOptions": {
"outDir": "./dist/types",
"outDir": "./dist",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": false,
"strictPropertyInitialization": false,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "./dist/types",
"declarationDir": "./dist",
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
Expand Down

0 comments on commit 8be5c20

Please sign in to comment.