UNPKG

2 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/vmdk-read.spec.js"],"names":[],"mappings":";;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;;;AAEA,qBAAS,cAAT,EAAyB,YAAM;AAC7B,iBAAG,2BAAH,6DAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAC1B,uBAD0B,GACZ,aADY;AAE1B,oBAF0B,GAEf,kBAFe;AAAA;AAAA,mBAGxB,+BAAK,4CAA4C,WAAjD,CAHwB;;AAAA;AAAA;AAAA,mBAIxB,+BAAK,WAAW,QAAX,GAAsB,8DAAtB,GAAuF,WAAvF,GAAqG,GAArG,GAA2G,QAAhH,CAJwB;;AAAA;AAKxB,kBALwB,GAKf,+BAAqB,iCAAiB,QAAjB,CAArB,CALe;AAAA;AAAA,mBAMT,OAAO,UAAP,EANS;;AAAA;AAMxB,kBANwB;AAOxB,qBAPwB,GAOZ,EAPY;;AAAA;AAAA,iBAQvB,IARuB;AAAA;AAAA;AAAA;;AAAA;AAAA,mBASV,OAAO,IAAP,EATU;;AAAA;AAStB,eATsB;;AAAA,kBAUxB,QAAQ,IAVgB;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAa5B,sBAAU,IAAV,CAAe,GAAf;AAb4B;AAAA;;AAAA;AAe9B,yBAAO,KAAP,CAAa,UAAU,MAAvB,EAA+B,CAA/B;AACA,yBAAO,KAAP,CAAa,UAAU,CAAV,EAAa,GAA1B,EAA+B,CAA/B;AACA,yBAAO,KAAP,CAAa,UAAU,CAAV,EAAa,GAA1B,EAA+B,OAAO,kBAAP,CAA/B;;AAjB8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAhC,IAkBG,OAlBH,CAkBW,KAlBX;AAmBD,CApBD","file":"vmdk-read.spec.js","sourcesContent":["import {assert} from 'chai'\nimport {createReadStream} from 'fs-promise'\nimport {describe, it} from 'mocha'\nimport {exec} from 'child-process-promise'\n\nimport {VMDKDirectParser} from './vmdk-read'\n\ndescribe('VMDK reading', () => {\n it('VMDKDirectParser reads OK', async () => {\n let rawFileName = 'random-data'\n let fileName = 'random-data.vmdk'\n await exec('base64 /dev/urandom | head -c 104448 > ' + rawFileName)\n await exec('rm -f ' + fileName + '&& VBoxManage convertfromraw --format VMDK --variant Stream ' + rawFileName + ' ' + fileName)\n const parser = new VMDKDirectParser(createReadStream(fileName))\n const header = await parser.readHeader()\n const harvested = []\n while (true) {\n const res = await parser.next()\n if (res === null) {\n break\n }\n harvested.push(res)\n }\n assert.equal(harvested.length, 2)\n assert.equal(harvested[0].lba, 0)\n assert.equal(harvested[1].lba, header['grainSizeSectors'])\n }).timeout(10000)\n})\n"]}
\No newline at end of file