@prisma/generator-helper
Advanced tools
Comparing version
@@ -73,3 +73,3 @@ "use strict"; | ||
"requiresGenerators": Array [ | ||
"photonjs", | ||
"prisma-client-js", | ||
], | ||
@@ -88,3 +88,6 @@ } | ||
})); | ||
test('non existent executable', () => __awaiter(void 0, void 0, void 0, function* () { | ||
expect(() => new GeneratorProcess_1.GeneratorProcess('this-is-a-random-path')).toThrowErrorMatchingInlineSnapshot(`"Error in generator: Can't find executable this-is-a-random-path"`); | ||
})); | ||
}); | ||
//# sourceMappingURL=generatorHandler.test.js.map |
@@ -36,2 +36,5 @@ "use strict"; | ||
this.initialized = false; | ||
if (!fs_1.default.existsSync(executablePath)) { | ||
throw new Error(`Error in generator: Can't find executable ${executablePath}`); | ||
} | ||
} | ||
@@ -38,0 +41,0 @@ init() { |
{ | ||
"name": "@prisma/generator-helper", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"main": "dist/index.js", | ||
@@ -41,2 +41,3 @@ "types": "dist/index.d.ts", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^24.2.0", | ||
@@ -43,0 +44,0 @@ "ts-node": "^8.5.4", |
@@ -68,3 +68,3 @@ import { GeneratorProcess } from '../GeneratorProcess' | ||
"requiresGenerators": Array [ | ||
"photonjs", | ||
"prisma-client-js", | ||
], | ||
@@ -86,2 +86,9 @@ } | ||
}) | ||
test('non existent executable', async () => { | ||
expect( | ||
() => new GeneratorProcess('this-is-a-random-path'), | ||
).toThrowErrorMatchingInlineSnapshot( | ||
`"Error in generator: Can't find executable this-is-a-random-path"`, | ||
) | ||
}) | ||
}) |
@@ -28,3 +28,9 @@ import { ChildProcessByStdio } from 'child_process' | ||
private initialized: boolean = false | ||
constructor(private executablePath: string) {} | ||
constructor(private executablePath: string) { | ||
if (!fs.existsSync(executablePath)) { | ||
throw new Error( | ||
`Error in generator: Can't find executable ${executablePath}`, | ||
) | ||
} | ||
} | ||
async init() { | ||
@@ -31,0 +37,0 @@ if (!this.initPromise) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
58805
2.03%1379
1.4%7
16.67%