Skip to content

Commit

Permalink
Fix unit test to use execState
Browse files Browse the repository at this point in the history
  • Loading branch information
jtran committed Oct 5, 2024
1 parent 2cf04f4 commit 38396e1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/lang/artifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const mySketch001 = startSketchOn('XY')
|> lineTo([-1.59, -1.54], %)
|> lineTo([0.46, -5.82], %)
// |> rx(45, %)`
const programMemory = await enginelessExecutor(parse(code))
const execState = await enginelessExecutor(parse(code))
// @ts-ignore
const sketch001 = programMemory?.get('mySketch001')
const sketch001 = execState.memory.get('mySketch001')
expect(sketch001).toEqual({
type: 'UserVal',
__meta: [{ sourceRange: [46, 71] }],
Expand Down Expand Up @@ -68,9 +68,9 @@ const mySketch001 = startSketchOn('XY')
|> lineTo([0.46, -5.82], %)
// |> rx(45, %)
|> extrude(2, %)`
const programMemory = await enginelessExecutor(parse(code))
const execState = await enginelessExecutor(parse(code))
// @ts-ignore
const sketch001 = programMemory?.get('mySketch001')
const sketch001 = execState.memory.get('mySketch001')
expect(sketch001).toEqual({
type: 'Solid',
id: expect.any(String),
Expand Down Expand Up @@ -148,9 +148,10 @@ const sk2 = startSketchOn('XY')
|> extrude(2, %)
`
const programMemory = await enginelessExecutor(parse(code))
const execState = await enginelessExecutor(parse(code))
const programMemory = execState.memory
// @ts-ignore
const geos = [programMemory?.get('theExtrude'), programMemory?.get('sk2')]
const geos = [programMemory.get('theExtrude'), programMemory.get('sk2')]
expect(geos).toEqual([
{
type: 'Solid',
Expand Down

0 comments on commit 38396e1

Please sign in to comment.