Skip to content

Commit 79f20df

Browse files
committed
Reduce expected number of calls to get tests passing
It used to be 2 because a document from a previous test was left open, which triggered the update twice (once during the direct invocation, and once during the faked document changed notification). Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 76f8bf1 commit 79f20df

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

test/completion.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ describe('Completion should work in multiple different scenarios', () => {
1616
await resetSettings('schemaStore.enable', true);
1717
});
1818

19+
after(async () => {
20+
vscode.window.tabGroups.close(vscode.window.tabGroups.activeTabGroup);
21+
});
22+
1923
it('completion works with local schema', async () => {
2024
await activate(docUri);
2125
const schemaPath = path.join(__dirname, '..', '..', 'test', 'testFixture', 'schemas', 'basic_completion_schema.json');

test/json-schema-selection.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Status bar should work in multiple different scenarios', () => {
6666
expect(statusBar.text).to.equal('bar schema');
6767
expect(statusBar.tooltip).to.equal('Select JSON Schema');
6868
expect(statusBar.backgroundColor).to.be.undefined;
69-
expect(statusBar.show).calledTwice;
69+
expect(statusBar.show).calledOnce;
7070
});
7171

7272
it('Should inform if there are no schema', async () => {
@@ -85,7 +85,7 @@ describe('Status bar should work in multiple different scenarios', () => {
8585
expect(statusBar.text).to.equal('No JSON Schema');
8686
expect(statusBar.tooltip).to.equal('Select JSON Schema');
8787
expect(statusBar.backgroundColor).to.be.undefined;
88-
expect(statusBar.show).calledTwice;
88+
expect(statusBar.show).calledOnce;
8989
});
9090

9191
it('Should inform if there are more than one schema', async () => {
@@ -104,7 +104,7 @@ describe('Status bar should work in multiple different scenarios', () => {
104104
expect(statusBar.text).to.equal('Multiple JSON Schemas...');
105105
expect(statusBar.tooltip).to.equal('Multiple JSON Schema used to validate this file, click to select one');
106106
expect(statusBar.backgroundColor).to.eql({ id: 'statusBarItem.warningBackground' });
107-
expect(statusBar.show).calledTwice;
107+
expect(statusBar.show).calledOnce;
108108
});
109109

110110
it('Should show JSON Schema Store schema version', async () => {
@@ -128,7 +128,7 @@ describe('Status bar should work in multiple different scenarios', () => {
128128
expect(statusBar.text).to.equal('bar schema(1.0.0)');
129129
expect(statusBar.tooltip).to.equal('Select JSON Schema');
130130
expect(statusBar.backgroundColor).to.be.undefined;
131-
expect(statusBar.show).calledTwice;
131+
expect(statusBar.show).calledOnce;
132132
});
133133

134134
it('Should show JSON Schema Store schema version, dont include version', async () => {
@@ -152,6 +152,6 @@ describe('Status bar should work in multiple different scenarios', () => {
152152
expect(statusBar.text).to.equal('bar schema(1.0.0)');
153153
expect(statusBar.tooltip).to.equal('Select JSON Schema');
154154
expect(statusBar.backgroundColor).to.be.undefined;
155-
expect(statusBar.show).calledTwice;
155+
expect(statusBar.show).calledOnce;
156156
});
157157
});

0 commit comments

Comments
 (0)