Skip to content

Commit

Permalink
Merge pull request #680 from gorkem/drive-letter
Browse files Browse the repository at this point in the history
Make test agnostic of drive letter
  • Loading branch information
msivasubramaniaan authored Mar 13, 2022
2 parents 7a2cb7e + 1e6a844 commit 1f5c37b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/yamlSchemaService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as sinon from 'sinon';
import * as chai from 'chai';
import * as sinonChai from 'sinon-chai';
import * as path from 'path';
import * as SchemaService from '../src/languageservice/services/yamlSchemaService';
import { parse } from '../src/languageservice/parser/yamlParser07';

Expand Down Expand Up @@ -107,8 +108,9 @@ describe('YAML Schema Service', () => {

expect(requestServiceMock).calledTwice;
if (process.platform === 'win32') {
expect(requestServiceMock).calledWithExactly('file:///d%3A/schema.json');
expect(requestServiceMock).calledWithExactly('file:///d%3A/schema.json#/definitions/schemaArray');
const driveLetter = path.parse(__dirname).root.split(':')[0].toLowerCase();
expect(requestServiceMock).calledWithExactly(`file:///${driveLetter}%3A/schema.json`);
expect(requestServiceMock).calledWithExactly(`file:///${driveLetter}%3A/schema.json#/definitions/schemaArray`);
} else {
expect(requestServiceMock).calledWithExactly('file:///schema.json');
expect(requestServiceMock).calledWithExactly('file:///schema.json#/definitions/schemaArray');
Expand Down

0 comments on commit 1f5c37b

Please sign in to comment.