Skip to content

Commit

Permalink
test: update unit tests to compare to original order of definitions (#…
Browse files Browse the repository at this point in the history
…584)

Fixes #583
  • Loading branch information
chrispcampbell authored Dec 8, 2024
1 parent 013bbf7 commit 5549c2a
Show file tree
Hide file tree
Showing 5 changed files with 3,332 additions and 2,663 deletions.
2 changes: 1 addition & 1 deletion packages/compile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"precommit": "../../scripts/precommit",
"type-check": "tsc --noEmit -p tsconfig-test.json",
"test": "vitest run",
"test:watch": "vitest",
"test:watch": "vitest --hideSkippedTests",
"test:ci": "vitest run",
"ci:build": "run-s lint prettier:check type-check test:ci"
},
Expand Down
8 changes: 1 addition & 7 deletions packages/compile/src/_tests/test-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,7 @@ export function parseVensimModel(modelName: string): ParsedModel {
const modelDir = sampleModelDir(modelName)
const modelFile = resolve(modelDir, `${modelName}.mdl`)
const mdlContent = readFileSync(modelFile, 'utf8')

// TODO: We currently sort the preprocessed definitions alphabetically for
// compatibility with tests that were written back when we used the legacy
// preprocessor, which sorted definitions alphabetically. Now that we no
// longer rely on the legacy preprocessor, we should update the tests to
// use the original order and remove this option.
return parseModel(mdlContent, modelDir, { sort: true })
return parseModel(mdlContent, modelDir)
}

export function parseInlineVensimModel(mdlContent: string, modelDir?: string): ParsedModel {
Expand Down
Loading

0 comments on commit 5549c2a

Please sign in to comment.