2022-04-22 13:43:37 +00:00
|
|
|
open Jest
|
|
|
|
open Reducer_TestHelpers
|
|
|
|
|
|
|
|
/*
|
|
|
|
You can wrap around any expression with inspect(expr) to log the value of that expression.
|
|
|
|
This is useful for debugging. inspect(expr) returns the value of expr, but also prints it out.
|
2022-04-22 14:18:00 +00:00
|
|
|
|
2022-04-22 13:43:37 +00:00
|
|
|
There is a second version of inspect that takes a label, which will print out the label and the value.
|
2022-04-22 14:18:00 +00:00
|
|
|
|
|
|
|
inpsectPerformace(expr, label) will print out the value of expr, the label, and the time it took to evaluate expr.
|
2022-04-22 13:43:37 +00:00
|
|
|
*/
|
|
|
|
describe("Debugging", () => {
|
2022-04-24 16:42:54 +00:00
|
|
|
testEvalToBe("inspect(1)", "Ok(1)")
|
|
|
|
testEvalToBe("inspect(1, \"one\")", "Ok(1)")
|
|
|
|
testEvalToBe("inspect(1, \"one\")", "Ok(1)")
|
|
|
|
testEvalToBe("inspectPerformance(1, \"one\")", "Ok(1)")
|
2022-04-22 13:43:37 +00:00
|
|
|
})
|