squiggle/packages/squiggle-lang/__tests__/JS__Test.js

17 lines
547 B
JavaScript
Raw Normal View History

2022-01-29 23:56:44 +00:00
var js = require("../src/js/index.js");
describe("A simple result", () => {
test("mean(normal(5,2))", () => {
2022-02-18 01:50:32 +00:00
expect(js.run("mean(normal(5,2))")).toEqual({ tag: 'Ok', value: { hd: { NAME: 'Float', VAL: 5 }, tl: 0 } });
2022-01-29 23:56:44 +00:00
});
test("10+10", () => {
2022-02-18 01:50:32 +00:00
let foo = js.run("normal(5,2)");
2022-01-29 23:56:44 +00:00
console.log(foo.value.hd.VAL)
expect(1).toEqual(1);
});
2022-02-18 02:26:39 +00:00
test("log(1) = 0", () => {
let foo = js.run("log(1)");
expect(foo).toEqual({ tag: 'Ok', value: { hd: { NAME: 'Float', VAL: 0}, tl: 0}});
})
2022-02-18 01:50:32 +00:00
});