diff --git a/jest-slow.config.cjs b/jest-slow.config.cjs index 9b47f45fd1..c04d2b1210 100644 --- a/jest-slow.config.cjs +++ b/jest-slow.config.cjs @@ -6,6 +6,6 @@ const config = require('./jest.config.cjs'); module.exports = { ...config, displayName: 'all-tests', - globalSetup: './jest/globalSetup.ts', - globalTeardown: './jest/globalTeardown.ts' + globalSetup: './jest/globalSetup.cjs', + globalTeardown: './jest/globalTeardown.cjs' }; diff --git a/jest/globalSetup.ts b/jest/globalSetup.cjs similarity index 76% rename from jest/globalSetup.ts rename to jest/globalSetup.cjs index df9039b71d..6e8d2c028a 100644 --- a/jest/globalSetup.ts +++ b/jest/globalSetup.cjs @@ -1,11 +1,7 @@ // Copyright 2017-2021 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AlwaysPullPolicy, GenericContainer, Wait } from 'testcontainers'; - -import { SubstrateTestsGlobal } from './substrateTestsGlobal'; - -declare const global: SubstrateTestsGlobal; +const { AlwaysPullPolicy, GenericContainer, Wait } = require('testcontainers'); const startSubstrate = async () => { console.log('Substrate container starting...'); @@ -24,6 +20,6 @@ const startSubstrate = async () => { global.__SUBSTRATE__ = startedTestContainer; }; -export default async (): Promise => { +module.exports = async () => { await startSubstrate(); }; diff --git a/jest/globalTeardown.ts b/jest/globalTeardown.cjs similarity index 59% rename from jest/globalTeardown.ts rename to jest/globalTeardown.cjs index 1e96a507e2..dfba7c7b42 100644 --- a/jest/globalTeardown.ts +++ b/jest/globalTeardown.cjs @@ -1,11 +1,7 @@ // Copyright 2017-2021 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { SubstrateTestsGlobal } from './substrateTestsGlobal'; - -declare const global: SubstrateTestsGlobal; - -export default async (): Promise => { +module.exports = async () => { console.log('Shutting down Substrate container...'); await global.__SUBSTRATE__.stop(); diff --git a/jest/substrateTestsGlobal.ts b/jest/substrateTestsGlobal.ts deleted file mode 100644 index 29e4e4681f..0000000000 --- a/jest/substrateTestsGlobal.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2017-2021 @polkadot/apps authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import { StartedTestContainer } from 'testcontainers'; - -export interface SubstrateTestsGlobal extends NodeJS.Global { - __SUBSTRATE__: StartedTestContainer; - // You can declare anything you need. -} diff --git a/packages/page-accounts/src/CreateAccount.slow.spec.tsx b/packages/page-accounts/src/CreateAccount.slow.spec.tsx index ebfec1c494..8874473bf6 100644 --- a/packages/page-accounts/src/CreateAccount.slow.spec.tsx +++ b/packages/page-accounts/src/CreateAccount.slow.spec.tsx @@ -43,7 +43,7 @@ const renderAccounts = () => { ); }; -describe.only('--SLOW--: Account Create', () => { +describe('--SLOW--: Account Create', () => { it('created account is added to list', async () => { const { findByTestId, findByText, queryByText } = renderAccounts();