Change global jest setup and teardown from TS to CommonJS (#6129)
This commit is contained in:
parent
b924bbcad6
commit
59b9e7aae2
@ -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'
|
||||
};
|
||||
|
||||
@ -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<void> => {
|
||||
module.exports = async () => {
|
||||
await startSubstrate();
|
||||
};
|
||||
@ -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<void> => {
|
||||
module.exports = async () => {
|
||||
console.log('Shutting down Substrate container...');
|
||||
|
||||
await global.__SUBSTRATE__.stop();
|
||||
@ -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.
|
||||
}
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user