Browse Source

chore(testing): Remove unused file

Michael Bromley 2 years ago
parent
commit
8cfdeba56c
1 changed files with 0 additions and 33 deletions
  1. 0 33
      packages/testing/src/utils/get-default-channel-token.ts

+ 0 - 33
packages/testing/src/utils/get-default-channel-token.ts

@@ -1,33 +0,0 @@
-import { DEFAULT_CHANNEL_CODE } from '@vendure/common/lib/shared-constants';
-import { Channel } from '@vendure/core';
-import { ConnectionOptions, getConnection } from 'typeorm';
-
-// tslint:disable:no-console
-// tslint:disable:no-floating-promises
-/**
- * Queries the database for the default Channel and returns its token.
- */
-export async function getDefaultChannelToken(logging = true): Promise<string> {
-    const connection = await getConnection();
-    let defaultChannel: Channel | undefined;
-    try {
-        defaultChannel = await connection.manager
-            .getRepository(Channel)
-            .findOne({
-                where: {
-                    code: DEFAULT_CHANNEL_CODE,
-                },
-            })
-            .then(result => result ?? undefined);
-    } catch (err: any) {
-        console.log(`Error occurred when attempting to get default Channel`);
-        console.log(err);
-    }
-    if (!defaultChannel) {
-        throw new Error(`No default channel could be found!`);
-    }
-    if (logging) {
-        console.log(`Got default channel token: ${defaultChannel.token}`);
-    }
-    return defaultChannel.token;
-}