Skip to content

Commit

Permalink
Use URI.toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Dec 7, 2023
1 parent 1f39688 commit 71330ba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/language-server/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ export function createConnection() {
* @returns {string} The uri that matches the fixture file name.
*/
export function fixtureUri(fileName) {
return String(
URI.parse(String(new URL(`../../../fixtures/${fileName}`, import.meta.url)))
)
return URI.parse(String(new URL(`../../../fixtures/${fileName}`, import.meta.url))).toString()
}

/**
Expand All @@ -83,7 +81,7 @@ export function fixturePath(fileName) {
*/
export async function openTextDocument(connection, fileName) {
const url = new URL(`../../../fixtures/${fileName}`, import.meta.url)
const uri = String(URI.parse(String(url)))
const uri = URI.parse(String(url)).toString()
const text = await fs.readFile(url, 'utf8')
/** @type {TextDocumentItem} */
const textDocument = {
Expand Down

0 comments on commit 71330ba

Please sign in to comment.