0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/e2e-cli/utils/expect.ts

14 lines
336 B
TypeScript
Raw Normal View History

2019-12-15 11:06:28 -05:00
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...`));
}
});
});
2019-12-15 11:06:28 -05:00
}