Skip to content

Commit

Permalink
Fix some flaky unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuester committed Oct 9, 2024
1 parent 96bb996 commit ecfec46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/fn/compile-app-settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ describe('compile-app-settings', () => {
.excludingEvery(['rules', 'contact_summary'])
.to.deep.eq(expected);
}
});
}).timeout(4000);
}
});
5 changes: 2 additions & 3 deletions test/fn/move-contacts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require('../../src/lib/sync-fs');
const environment = require('../../src/lib/environment');

const PouchDB = require('pouchdb-core');
PouchDB.plugin(require('pouchdb-adapter-http'));
PouchDB.plugin(require('pouchdb-adapter-memory'));
PouchDB.plugin(require('pouchdb-mapreduce'));

const moveContactsModule = rewire('../../src/fn/move-contacts');
Expand Down Expand Up @@ -50,8 +50,7 @@ describe('move-contacts', () => {
const updateHierarchyRules = contact_types => upsert('settings', { settings: { contact_types } });

beforeEach(async () => {
// using remote couchdb because of https://github.com/pouchdb/pouchdb/issues/8370
pouchDb = new PouchDB(`http://localhost:6984/scenario${scenarioCount++}`);
pouchDb = new PouchDB(`move-contacts-${scenarioCount++}`);

await mockHierarchy(pouchDb, {
district_1: {
Expand Down
4 changes: 2 additions & 2 deletions test/fn/watch-project.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('watch-project', () => {
.then(mockApi.getAppSettings)
.then((settings) => JSON.parse(settings.content))
.then((settings) => expect(settings.locale).equal('es'));
});
}).timeout(16000);

it('watch-project: convert app settings', () => {
const appSettingsPath = path.join(testDir, 'app_settings.json');
Expand All @@ -178,7 +178,7 @@ describe('watch-project', () => {
.then(messages => {
assert.deepEqual(messages.custom, { a: 'first', test: 'new' });
});
});
}).timeout(16000);

it('watch-project: upload resources', () => {
return watchWrapper(editResources, 'resources.json')
Expand Down

0 comments on commit ecfec46

Please sign in to comment.