Open kitsunde opened 1 year ago
Hello,
I setup jest in each test file, but his an issue where in test.concurrent the table doesn't seem to exist:
test.concurrent
require('jest-dynalite/withDb'); const { DynamoDB } = require('aws-sdk'); const client = new DynamoDB({ ...(process.env.MOCK_DYNAMODB_ENDPOINT && { endpoint: process.env.MOCK_DYNAMODB_ENDPOINT, sslEnabled: false, region: 'local', }), }); describe('dynalite', () => { test.concurrent('will contain tables concurrent', async () => { const tables = await client.listTables().promise(); expect(tables.TableNames.length).toEqual(1); }); test('will contain tables not concurrnet', async () => { const tables = await client.listTables().promise(); expect(tables.TableNames.length).toEqual(1); }); });
This is when it's used with a setupBeforeEnv.js:
setupBeforeEnv.js
const { setup } = require('jest-dynalite'); setup(__dirname);
However if I switch to preset: 'jest-dynalite' both modes work.
preset: 'jest-dynalite'
To use concurrent you are gonna need to manually start and stop the DB. The default behaviour removes the tables and recreates them between each test, which I imagine doesn't work with concurrency.
Hello,
I setup jest in each test file, but his an issue where in
test.concurrent
the table doesn't seem to exist:This is when it's used with a
setupBeforeEnv.js
:However if I switch to
preset: 'jest-dynalite'
both modes work.