chore: fix test on windows 10

This commit is contained in:
Jun Yang
2019-03-02 03:36:33 +08:00
parent f960904df4
commit d44e1d727a
5 changed files with 49 additions and 8 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { isString, forOwn } from '../../src/util/underscore'
import fs from '../../src/fs/node'
import { resolve } from 'path'
type fileDescriptor = { mode: string, content: string }
@@ -9,8 +10,8 @@ const exists = fs.exists
export function mock (options: { [path: string]: (string | fileDescriptor) }) {
forOwn(options, (val, key) => {
files[key] = isString(val)
? { mode: '33188', content: val as string }
files[resolve(key)] = isString(val)
? { mode: '33188', content: val }
: val as fileDescriptor
})
fs.readFile = async function (path) {