Skip to content

Commit

Permalink
fixed test - take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Oct 14, 2021
1 parent 07ec719 commit d835a4c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Expand Up @@ -29,6 +29,7 @@ import { GqlService } from '../../../services';
import getRootTypes from '../../../utils/get-root-types';
import { DocView } from 'altair-graphql-core/build/types/state/docs.interfaces';
import { AltairConfig } from 'altair-graphql-core/build/config';
import { getDocUtilsWorkerAsyncClass } from './worker-helper';

@UntilDestroy()
@Component({
Expand Down Expand Up @@ -228,7 +229,7 @@ export class DocViewerComponent implements OnChanges {
async getDocUtilsWorker() {
if (!this.docUtilWorker) {
try {
const DocUtils: any = Comlink.wrap(new Worker(new URL('../doc-utils.worker', import.meta.url), { type: 'module' }));
const DocUtils: any = getDocUtilsWorkerAsyncClass();
this.docUtilWorker = await new DocUtils();
} catch (error) {
debug.error('Could not load doc utilsweb worker');
Expand Down
@@ -0,0 +1,3 @@
import * as Comlink from 'comlink';

export const getDocUtilsWorkerAsyncClass = () => Comlink.wrap(new Worker(new URL('../doc-utils.worker', import.meta.url), { type: 'module' }));
3 changes: 3 additions & 0 deletions packages/altair-app/src/setup-jest.ts
@@ -1,4 +1,7 @@
import 'jest-preset-angular/setup-jest';
jest.mock('./app/modules/altair/components/doc-viewer/doc-viewer/worker-helper', () => ({
getDocUtilsWorkerAsyncClass: () => {},
}))

/* global mocks for jsdom */
const mock = () => {
Expand Down
1 change: 1 addition & 0 deletions packages/altair-app/tsconfig.json
Expand Up @@ -17,6 +17,7 @@
"typeRoots": [
"node_modules/@types"
],
"downlevelIteration": true,
"lib": [
"es2016",
"dom",
Expand Down
8 changes: 4 additions & 4 deletions packages/altair-app/yarn.lock
Expand Up @@ -3484,10 +3484,10 @@ alphanum-sort@^1.0.2:
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=

altair-graphql-core@^4.0.9:
version "4.0.9"
resolved "https://registry.yarnpkg.com/altair-graphql-core/-/altair-graphql-core-4.0.9.tgz#c52fd7238bae91114f94c693646182bdf042c47e"
integrity sha512-nL6hCHRanErWaVFVJsVkDmFg1z6iegqywX0W2naovnH7LUHzNFk79lFODMLDtliKqvXa+oQQt+K97emOBpeTVQ==
altair-graphql-core@^4.0.11:
version "4.0.11"
resolved "https://registry.yarnpkg.com/altair-graphql-core/-/altair-graphql-core-4.0.11.tgz#1b8466f498a8ff65c80a2d80438b676e4bff8321"
integrity sha512-X40N49vEDft8Y/sETzGdzYl4uirfv/kQFxkOy2AFZdP32gYelxWKLdx+qDZMxPY3n92f3y5+X+Zm928gxXxI3w==
dependencies:
"@apollo/client" "^3.3.20"
actioncable "^5.2.6"
Expand Down

0 comments on commit d835a4c

Please sign in to comment.