nteract / nteract

📘 The interactive computing suite for you! ✨

Home Page:https://nteract.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test suite fails on MacOS 11.4 BigSur

marcdhansen opened this issue · comments

Application or Package Used
nteract desktop

Describe the bug
3 test suite failures

To Reproduce
follow build steps from contributing page (https://github.com/nteract/nteract/blob/main/CONTRIBUTING.md) using MacOS 11.4 BigSur. Test failures occur during the yarn test step

Expected behavior
all test suites either pass or skipped

Screenshots
n/a

Desktop (please complete the following information):

macOS Version 11.4
node v14.16.1
XCode:

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 12.5.0.0.1.1617976050

Additional context
`
Summary of all failing tests
FAIL applications/desktop/tests/renderer/global-events.spec.ts
● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

/Users/marchansen/GitHub/nteract/nteract/node_modules/file-url/index.js:1
import path from 'path';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at compileFunction (<anonymous>)

> 1 | import fileUrl from "file-url";
    | ^
  2 | import { of } from "rxjs";
  3 | import { windowing } from "../package";
  4 | 

  at Runtime._execModule (node_modules/jest-runtime/build/index.js:1166:56)
  at Object.<anonymous> (packages/mythic-windowing/src/myths/open-external.ts:1:1)
  at Object.<anonymous> (packages/mythic-windowing/src/index.ts:5:1)
  at Object.<anonymous> (applications/desktop/src/common/commands/by-menu/file.tsx:3:1)
  at Object.<anonymous> (applications/desktop/src/common/commands/index.ts:4:1)
  at Object.<anonymous> (applications/desktop/src/notebook/global-events.ts:5:1)
  at Object.<anonymous> (applications/desktop/__tests__/renderer/global-events.spec.ts:13:1)

FAIL applications/desktop/tests/renderer/epics/github-publish.spec.ts
● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

/Users/marchansen/GitHub/nteract/nteract/node_modules/file-url/index.js:1
import path from 'path';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at compileFunction (<anonymous>)

> 1 | import fileUrl from "file-url";
    | ^
  2 | import { of } from "rxjs";
  3 | import { windowing } from "../package";
  4 | 

  at Runtime._execModule (node_modules/jest-runtime/build/index.js:1166:56)
  at Object.<anonymous> (packages/mythic-windowing/src/myths/open-external.ts:1:1)
  at Object.<anonymous> (packages/mythic-windowing/src/index.ts:5:1)
  at Object.<anonymous> (applications/desktop/src/notebook/epics/github-publish.ts:3:1)
  at Object.<anonymous> (applications/desktop/__tests__/renderer/epics/github-publish.spec.ts:4:1)

FAIL applications/desktop/tests/renderer/epics/index.spec.ts
● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

/Users/marchansen/GitHub/nteract/nteract/node_modules/file-url/index.js:1
import path from 'path';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at compileFunction (<anonymous>)

> 1 | import fileUrl from "file-url";
    | ^
  2 | import { of } from "rxjs";
  3 | import { windowing } from "../package";
  4 | 

  at Runtime._execModule (node_modules/jest-runtime/build/index.js:1166:56)
  at Object.<anonymous> (packages/mythic-windowing/src/myths/open-external.ts:1:1)
  at Object.<anonymous> (packages/mythic-windowing/src/index.ts:5:1)
  at Object.<anonymous> (applications/desktop/src/notebook/epics/github-publish.ts:3:1)
  at Object.<anonymous> (applications/desktop/src/notebook/epics/index.ts:8:1)
  at Object.<anonymous> (applications/desktop/__tests__/renderer/epics/index.spec.ts:6:1)

Test Suites: 3 failed, 1 skipped, 77 passed, 80 of 81 total
Tests: 5 skipped, 493 passed, 498 total
Snapshots: 4 passed, 4 total
Time: 52.59 s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`

Can you share the steps you ran? I've been able to get things working on macOS 11.4 with the following steps:

yarn clean
yarn
yarn build
yarn test

I just tried with the same steps and still got the same 3 failures

yarn clean
yarn
yarn build
yarn test