Skip to content

Commit

Permalink
test: Fix openRandomNote tests under Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
svsool committed Aug 7, 2020
1 parent 236ef5e commit 90eb30c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/commands/openRandomNote.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
rndName,
getOpenedFilenames,
closeEditorsAndCleanWorkspace,
waitForExpect,
} from '../test/testUtils';

describe('openRandomNote command', () => {
Expand All @@ -31,9 +30,7 @@ describe('openRandomNote command', () => {
await openRandomNote();
await openRandomNote();

await waitForExpect(() => {
expect(getOpenedFilenames()).toEqual(expect.arrayContaining(filenames));
});
expect(getOpenedFilenames()).toEqual(expect.arrayContaining(filenames));
});

it('should open existing note only once on executing command multiple times', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/openRandomNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const openRandomNote = async () => {
const randomUri = markdownUris[randomUriIndex];

if (randomUri && fs.existsSync(randomUri.fsPath)) {
await commands.executeCommand('vscode.open', randomUri);
await commands.executeCommand('vscode.open', randomUri, { preview: false });
}
};

Expand Down

0 comments on commit 90eb30c

Please sign in to comment.