How to use the mock-require.stop function in mock-require

To help you get started, we’ve selected a few mock-require 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 blackbaud / skyux-builder / test / cli-utils-run-build.spec.js View on Github external
{
        encoding: 'utf8'
      }
    );

    // Ensure the TypeScript config file is written to disk.
    expect(writeJSONSpy).toHaveBeenCalledWith(
      skyPagesConfigUtil.spaPathTempSrc('tsconfig.json'),
      jasmine.objectContaining({
        'files': [
          './app/app.module.ts'
        ]
      })
    );

    mock.stop(f);
  });
github SAP / ui5-project / test / lib / translators / npm.js View on Github external
return npmTranslator.generateDependencyTree(applicationAPath).then((parsedTree) => {
		t.deepEqual(parsedTree, applicationATree, "Parsed correctly");
		mock.stop("@ui5/logger");
	});
});
github SAP / ui5-builder / test / lib / tasks / transformBootstrapHtml.js View on Github external
test.afterEach.always((t) => {
	mock.stop("@ui5/logger");
	mock.stop("../../../lib/processors/bootstrapHtmlTransformer");
	t.context.logWarnSpy.restore();
});
github SAP / ui5-builder / test / lib / processors / bootstrapHtmlTransformer.js View on Github external
test.afterEach.always((t) => {
	mock.stop("@ui5/logger");
	t.context.logWarnSpy.restore();
});
github blackbaud / skyux-builder / test / loader-assets.spec.js View on Github external
afterEach(() => {
    mock.stop('hash-file');
    mock.stop('fs');
  });
github ipfs / aegir / test / config / webpack.spec.js View on Github external
afterEach(() => {
    mock.stop('../../src/utils')
    mock.stop('../../src/config/user')
  })
github blackbaud / skyux-builder / test / config-webpack-build.spec.js View on Github external
runtime: runtimeUtils.getDefaultRuntime(),
      skyux: {
        command: 'CUSTOM_COMMAND'
      }
    };

    const config = lib.getWebpackConfig(skyPagesConfig);

    config.plugins.forEach(plugin => {
      if (plugin.name === 'DefinePlugin') {
        const command = JSON.parse(plugin.options.skyPagesConfig).skyux.command;
        expect(command).toBe(skyPagesConfig.skyux.command);
      }
    });

    mock.stop(f);
  });
github blackbaud / skyux-builder / test / config-webpack-build-aot.spec.js View on Github external
runtime: runtimeUtils.getDefaultRuntime({
        command: 'CUSTOM_COMMAND'
      }),
      skyux: {}
    };

    const config = lib.getWebpackConfig(skyPagesConfig);

    config.plugins.forEach(plugin => {
      if (plugin.name === 'DefinePlugin') {
        const command = JSON.parse(plugin.options.skyPagesConfig.runtime.command);
        expect(command).toBe(skyPagesConfig.runtime.command);
      }
    });

    mock.stop(f);
  });
github blackbaud / skyux-builder / test / cli-serve.spec.js View on Github external
called = true;
        return {
          devServer: {}
        };
      }
    });

    function webpackDevServer() {
      return {
        listen: () => {}
      };
    }

    require('../cli/serve')({}, {}, () => {}, webpackDevServer);
    expect(called).toEqual(true);
    mock.stop(f);
  });

mock-require

Simple, intuitive mocking of Node.js modules.

MIT
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis