This commit is contained in:
ggunullu
2023-02-02 15:54:20 +01:00
committed by florent Beauchamp
parent dd2b054b35
commit f0b93dc7fe
2 changed files with 10 additions and 1 deletions

View File

@@ -94,7 +94,7 @@
"prettify": "prettier --ignore-path .gitignore --write '**/*.{cjs,js,jsx,md,mjs,ts,tsx}'",
"test": "npm run test-lint && npm run test-unit",
"test-integration": "jest \".integ\\.spec\\.js$\"",
"test-lint": "eslint --ignore-path .gitignore --ignore-pattern packages/xo-web .",
"test-lint": "eslint --ignore-path .gitignore --ignore-pattern packages/xo-web . --ignore-pattern @xen-orchestra/vmware-explorer .",
"test-unit": "jest \"^(?!.*\\.integ\\.spec\\.js$)\" && scripts/run-script.js --bail test"
},
"workspaces": [

View File

@@ -22,6 +22,7 @@ const {
convertToVhdDirectory,
recoverRawContent,
} = require('../tests/utils')
const { test } = require('../_bitmap')
let tempDir = null
let handler
@@ -42,6 +43,14 @@ afterEach(async () => {
disposeHandler()
})
test('checkFile fails with broken VHD file', async () => {
const vhdFile = new VhdFile(handler, 'vhdFile.vhd')
await fs.writeFile(vhdFile, ';alsdkh;lasdhfjaksdhfjklsdahfhdsl')
await expect(async () => await checkFile(vhdFile)).rejects.toThrow()
})
test('respect the checkSecondFooter flag', async () => {
const initalSize = 0
const rawFileName = `${tempDir}/randomfile`