How to use the tree-kill.mockImplementation function in tree-kill

To help you get started, we’ve selected a few tree-kill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bennymeg / nx-electron / src / builders / execute / execute.impl.spec.ts View on Github external
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();
      }
    });
  });
github nrwl / nx / packages / node / src / builders / execute / execute.impl.spec.ts View on Github external
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: [],

tree-kill

kill trees of processes

MIT
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis