How to use jest-runner - 3 common examples

To help you get started, we’ve selected a few jest-runner 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 facebook-atom / jest-electron-runner / packages / electron / src / rpc / JestWorkerRPC.js View on Github external
const _runInNode = async (testData: IPCTestData): Promise => {
  try {
    return runTest(
      testData.path,
      testData.globalConfig,
      testData.config,
      getResolver(testData.config, testData.serialisableModuleMap),
    );
  } catch (error) {
    // eslint-disable-next-line no-console
    console.error(error);
    return buildFailureTestResult(
      testData.path,
      error,
      testData.config,
      testData.globalConfig,
    );
  }
};
github facebook-atom / jest-electron-runner / packages / electron / src / browser_window_injected_code.js View on Github external
async (event, testData: IPCTestData, workerID: string) => {
    try {
      const result = await runTest(
        testData.path,
        testData.globalConfig,
        testData.config,
        getResolver(testData.config, testData.serialisableModuleMap),
      );

      ipcRenderer.send(workerID, result);
    } catch (error) {
      ipcRenderer.send(
        workerID,
        buildFailureTestResult(
          testData.path,
          error,
          testData.config,
          testData.globalConfig,
        ),
github facebookarchive / atom-ide-ui / modules / jest-atom-runner / src / atomTestRunner.js View on Github external
connection.onMessage(message => {
      try {
        const {messageType, data} = parseMessage(message);

        switch (messageType) {
          case MESSAGE_TYPES.RUN_TEST: {
            const testData = parseJSON(data);
            runTest(
              testData.path,
              testData.globalConfig,
              testData.config,
              getResolver(testData.config, testData.rawModuleMap),
            )
              .catch(error => {
                const testResult = buildFailureTestResult(
                  testData.path,
                  error,
                  testData.config,
                  testData.globalConfig,
                );
                return testResult;
              })
              .then(result => {
                const msg = makeMessage({

jest-runner

MIT
Latest version published 1 year ago

Package Health Score

82 / 100
Full package analysis

Similar packages