Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should log errors from killing the process', async done => {
treeKill.mockImplementation((pid, signal, callback) => {
callback(new Error('Error Message'));
});
const loggerError = spyOn(context.logger, 'error');
scheduleTargetAndForget = scheduleTargetAndForget.and.returnValue(
from([
{ success: true, outfile: 'outfile.js' },
{ success: true, outfile: 'outfile.js' }
])
);
electronExecuteBuilderHandler(testOptions, context).subscribe({
complete: () => {
expect(loggerError.calls.argsFor(1)).toEqual(['Error Message']);
done();
}
});
});
beforeEach(async () => {
fork.mockReturnValue({
pid: 123
});
treeKill.mockImplementation((pid, signal, callback) => {
callback();
});
context = await getMockContext();
context.addTarget(
{
project: 'nodeapp',
target: 'build'
},
'@nrwl/node:build'
);
testOptions = {
inspect: true,
args: [],
buildTarget: 'nodeapp:build',
port: 9229,
waitUntilTargets: [],