mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
13 lines
313 B
TypeScript
13 lines
313 B
TypeScript
import * as fs from 'fs-extra';
|
|
|
|
export function expectFileToExist(fileName: string) {
|
|
return new Promise((resolve, reject) => {
|
|
fs.exists(fileName, (exist) => {
|
|
if (exist) {
|
|
resolve(exist);
|
|
} else {
|
|
reject(new Error(`File ${fileName} was expected to exist but not found...`));
|
|
}
|
|
});
|
|
});
|
|
}
|