Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f236663

Browse files
committedMay 1, 2023
chore(test): update esm test to verify correct behavior
Previously, it was verifying *incorrect* behavior.
1 parent fafee28 commit f236663

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
2020
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
2121
"test": "c8 mocha ./test/*.cjs",
22-
"test:esm": "c8 mocha ./test/esm/cliui-test.mjs",
22+
"test:esm": "c8 mocha ./test/**/*.mjs",
2323
"postest": "check",
2424
"coverage": "c8 report --check-coverage",
2525
"precompile": "rimraf build",

‎test/deno/cliui-test.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ Deno.test('evenly divides text across columns if multiple columns are given', ()
3636
})
3737

3838
// it should wrap each column appropriately.
39-
// TODO: we should flesh out the Deno and ESM implementation
40-
// such that it spreads words out over multiple columns appropriately:
4139
const expected = [
42-
'i am a string ti am a seconi am a third',
43-
'hat should be wd string tha string that',
44-
'rapped t should be should be w',
45-
' wrapped rapped'
40+
'i am a string i am a i am a third',
41+
'that should be second string that',
42+
'wrapped string that should be',
43+
' should be wrapped',
44+
' wrapped',
4645
]
4746

4847
ui.toString().split('\n').forEach((line: string, i: number) => {

‎test/esm/cliui-test.mjs

+6-5
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ describe('ESM', () => {
3535
// TODO: we should flesh out the Deno and ESM implementation
3636
// such that it spreads words out over multiple columns appropriately:
3737
const expected = [
38-
'i am a string ti am a seconi am a third',
39-
'hat should be wd string tha string that',
40-
'rapped t should be should be w',
41-
' wrapped rapped'
38+
'i am a string i am a i am a third',
39+
'that should be second string that',
40+
'wrapped string that should be',
41+
' should be wrapped',
42+
' wrapped',
4243
]
4344
ui.toString().split('\n').forEach((line, i) => {
4445
strictEqual(line, expected[i])
4546
})
4647
})
47-
})
48+
})

0 commit comments

Comments
 (0)
Please sign in to comment.