mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
test(storage): replace the hacky test
This commit is contained in:
parent
35f0b539d9
commit
933034f3c9
1 changed files with 4 additions and 4 deletions
|
@ -103,11 +103,11 @@ describe('StorageTest', () => {
|
|||
fs.mkdirSync(path.join(storagePath, 'npm_test'))
|
||||
fs.writeFileSync(metadataPath, fs.readFileSync(metadataSource));
|
||||
const metadata = JSON.parse(fs.readFileSync(metadataPath).toString())
|
||||
const prevStat = fs.statSync(metadataPath)
|
||||
// $FlowFixMe
|
||||
storage.localStorage.updateVersions = jest.fn(storage.localStorage.updateVersions)
|
||||
storage._syncUplinksMetadata('npm_test', metadata, {}, (err) => {
|
||||
expect(err).toBeFalsy()
|
||||
const nextStat = fs.statSync(metadataPath)
|
||||
expect(nextStat).toEqual(prevStat)
|
||||
expect(err).toBeNull()
|
||||
expect(storage.localStorage.updateVersions).not.toHaveBeenCalled()
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue