Skip to content

Commit

Permalink
test: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvishnun committed Dec 11, 2023
1 parent c2db5ff commit 448ff78
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/subapp-server/test/spec/utils.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
"use strict";

describe("subapp-server utils", () => {});
const chai = require('chai');
const expect = chai.expect;
const { until } = require("../../lib/utils");

describe('subapp-server utils', function() {
this.timeout(8000);

it('should resolve when the condition is met before the max wait time', async function() {
let conditionMet = false;
setTimeout(() => {
conditionMet = true;
}, 1000);

await until(() => conditionMet, 3000);
expect(conditionMet).to.be.true;
});

});

0 comments on commit 448ff78

Please sign in to comment.