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

16 lines
479 B
TypeScript
Raw Permalink Normal View History

2022-02-18 02:16:31 +00:00
import { run } from '../src/js/index';
2022-01-29 23:56:44 +00:00
describe("A simple result", () => {
test("mean(normal(5,2))", () => {
2022-02-27 04:25:30 +00:00
expect(run("mean(normal(5,2))")).toEqual({ tag: 'Ok', value: [ { NAME: 'Float', VAL: 5 } ] });
2022-01-29 23:56:44 +00:00
});
test("10+10", () => {
2022-02-18 02:16:31 +00:00
let foo = run("normal(5,2)");
2022-01-29 23:56:44 +00:00
expect(1).toEqual(1);
});
2022-02-18 02:26:39 +00:00
test("log(1) = 0", () => {
2022-02-18 03:14:07 +00:00
let foo = run("log(1)");
2022-02-27 04:25:30 +00:00
expect(foo).toEqual({ tag: 'Ok', value: [ { NAME: 'Float', VAL: 0} ]});
2022-02-18 02:26:39 +00:00
})
2022-02-18 01:50:32 +00:00
});