mirror of
https://github.com/iptv-org/epg
synced 2025-12-23 05:46:40 -05:00
Replace path.resolve with pathToFileURL
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs-extra'
|
||||
import { execSync } from 'child_process'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
type ExecError = {
|
||||
status: number
|
||||
@@ -46,7 +46,7 @@ describe('channels:editor', () => {
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(path.resolve(filepath), {
|
||||
return fs.readFileSync(pathToFileURL(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
@@ -24,7 +24,7 @@ describe('channels:parse', () => {
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(path.resolve(filepath), {
|
||||
return fs.readFileSync(pathToFileURL(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user