packager-worker-for-buck: transformCommand: add test

Reviewed By: davidaurelio

Differential Revision: D6232002

fbshipit-source-id: 8bdd0dd0dabff4b92b4c2d7b4c3f7a2d90723bee
This commit is contained in:
Jean Lauliac 2017-11-06 03:30:06 -08:00 committed by Facebook Github Bot
parent e0202e459f
commit 73a01be9bc
1 changed files with 4 additions and 2 deletions

View File

@ -255,7 +255,7 @@ fs.open.mockImplementation(function(filepath) {
}
if (error || data == null) {
error = Error(`ENOENT: no such file or directory, open ${filepath}`);
error = Error(`ENOENT: no such file or directory: \`${filepath}\``);
}
if (data != null) {
/* global Buffer: true */
@ -409,7 +409,9 @@ function getToNode(filepath) {
}
node = node[part];
if (node == null) {
const err = new Error('ENOENT: no such file or directory');
const err = new Error(
`ENOENT: no such file or directory: \`${filepath}\``,
);
err.code = 'ENOENT';
throw err;
}