February 2019
Beginner to intermediate
180 pages
4h 4m
English
Let's create our first test in __tests__/First_test.re with something simple for now:
/* __tests__/First_test.re */open Jest;describe("Expect", () => Expect.(test("toBe", () => expect(1 + 2) |> toBe(3) )));
Running npm test now fails with the following error:
FAIL lib/es6/__tests__/First_test.bs.js ● 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. ...
Read now
Unlock full access