Skip to content

Instantly share code, notes, and snippets.

@superherointj
Created March 31, 2020 19:14
Show Gist options
  • Save superherointj/cbe2746dcb59da5facb36282c1eac7b8 to your computer and use it in GitHub Desktop.
Save superherointj/cbe2746dcb59da5facb36282c1eac7b8 to your computer and use it in GitHub Desktop.
Rely demo error
;; dune file
(library
(name BatciTest)
(public_name batci-test.lib)
(ocamlopt_flags -linkall -g) ; the linkall flag ensures that all of our tests are compiled and the -g flag emits debugging information
(libraries rely.lib)
; (flags (:standard -w -30-9)) ; Supress Error (warning 9): the following labels are not bound in this record pattern: ({test}) => { ({expect}) => {
(modules (:standard \ RunTests))
)
(executable
; the for the library is automatically detected because of the name, but we need to explicitly specify the package here
(name RunTests)
(public_name RunTests.exe)
(libraries rely.lib batci-test.lib)
(ocamlopt_flags ( -linkall -g )) ; From package.json ocamloptFlags field
(modules RunTests)
(package batci-test)
)
2700x-PC intj ~/git/monorepo/packages/batci (master) $ esy build
info esy build 0.6.2 (using package.json)
File "test/lib/MyFirstTest.re", line 4, characters 33-39:
4 | describe("my first test suite", ({test}) => {
^^^^^^
Error (warning 9): the following labels are not bound in this record pattern:
describe, describeSkip, describeOnly, testSkip, testOnly
Either bind these labels explicitly or add '; _' to the pattern.
File "test/lib/MyFirstTest.re", line 5, characters 32-40:
5 | test("1 + 1 should equal 2", ({expect}) => {
^^^^^^^^
Error (warning 9): the following labels are not bound in this record pattern:
env
Either bind these labels explicitly or add '; _' to the pattern.
error: command failed: 'dune' 'build' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1
esy: exiting due to errors above
/* MyFirstTest.re */
open TestFramework;
describe("my first test suite", ({test}) => {
test("1 + 1 should equal 2", ({expect}) => {
expect.int(1 + 1).toBe(2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment