Skip to content

Commit

Permalink
test(utils): 修复文件读取失败
Browse files Browse the repository at this point in the history
  • Loading branch information
vfiee committed Jun 2, 2022
1 parent da9bf29 commit 21e9e81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
7 changes: 4 additions & 3 deletions packages/utils/__tests__/is/is.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ describe('is', () => {
expect(isBlob(blob)).toBe(true)
})
test('isFile', () => {
const filePath = path.join(__dirname, 'is.spec.ts')
const filePath = path.join(__dirname, '../../package.json')
const file = new File(
[fs.readFileSync(filePath).toString()],
'package.json',
Expand All @@ -329,8 +329,9 @@ describe('is', () => {
expect(isArrayBufferView(dataView)).toBe(true)
})
test('isStream', () => {
const readStream = fs.createReadStream('../../package.json')
const writeStream = fs.createWriteStream('../../package.json')
const filePath = path.join(__dirname, '../../package.json')
const readStream = fs.createReadStream(filePath)
const writeStream = fs.createWriteStream(filePath)
expect(isStream(readStream)).toBe(true)
expect(isStream(writeStream)).toBe(true)
})
Expand Down
27 changes: 0 additions & 27 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +0,0 @@
{
"name": "@vyron/utils",
"version": "0.1.0",
"main": "index.js",
"module": "dist/utils.esm.js",
"types": "dist/utils.d.ts",
"globalPackageName": "utils",
"description": "JavaScript utils",
"keywords": [
"utils",
"javascript",
"typescript"
],
"files": [
"dist",
"LICENSE",
"index.js",
"README.md",
"package.json"
],
"author": "vyron",
"license": "MIT",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}

0 comments on commit 21e9e81

Please sign in to comment.