Skip to content

Commit 258e522

Browse files
committed
Fix CI
1 parent 6a7634e commit 258e522

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"dev": "node --watch --import tsx --test test/*.ts",
1313
"build:bundle": "esbuild lib/index.ts --bundle --format=esm --sourcemap --allow-overwrite --outfile=./dist/superhistory.esm.js",
1414
"build:types": "npx tsc -p tsconfig.test.json && npx tsc",
15+
"build:test": "npm run test",
1516
"build:clear": "rm -fr ./dist",
16-
"build": "npm run build:clear && npm run build:bundle && npm run build:types",
17+
"build": "npm run build:clear && npm run build:bundle && npm run build:types && npm run build:test",
1718
"prepublishOnly": "npm version prerelease --preid=next && npm run build"
1819
},
1920
"publishConfig": {

test/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ test('Basics', () => {
2121
A.go('/a/b/c/d/e/f/g/', { replace: true })
2222
const b = A.get()
2323

24-
assert.deepEqual(a, { path: '/a/b/c/d/e/f/g' })
24+
assert.deepEqual(a, { path: '/a/b/c/d/e/f/g', fullPath: '/a/b/c/d/e/f/g' })
2525
assert.deepEqual(a, b, 'path normalization')
2626

2727
const B1 = A.child({ prefix: '/a/b' })
2828
const B2 = A.child({ prefix: '/a/b/' })
2929

30-
assert.deepEqual(B1.get(), { path: '/c/d/e/f/g' })
30+
assert.deepEqual(B1.get(), { path: '/c/d/e/f/g', fullPath: '/a/b/c/d/e/f/g' })
3131
assert.deepEqual(B1.get(), B2.get())
3232

3333
A.go('/a/c/d')
@@ -37,23 +37,23 @@ test('Basics', () => {
3737
`If child path isn't applicable, it has an undefined path`,
3838
)
3939

40-
assert.deepEqual(A.get(), { path: '/a/c/d' })
40+
assert.deepEqual(A.get(), { path: '/a/c/d', fullPath: '/a/c/d' })
4141
B1.go('/d')
4242
assert.deepEqual(
4343
A.get(),
44-
{ path: '/a/b/d' },
44+
{ path: '/a/b/d', fullPath:'/a/b/d' },
4545
'Writing to subroute reactivated its original prefix',
4646
)
4747

48-
assert.deepEqual(B1.get(), { path: '/d' }, 'And path is no longer undefined')
48+
assert.deepEqual(B1.get(), { path: '/d', fullPath:'/a/b/d' }, 'And path is no longer undefined')
4949
assert.deepEqual(B1.get(), B2.get(), 'B1 and B2 are in sync')
5050

5151
B2.go('/c')
5252

5353
const C1 = B1.child({ prefix: '/c' })
5454
const C2 = B2.child({ prefix: '/c' })
5555

56-
assert.deepEqual(C1.get(), { path: '/' })
56+
assert.deepEqual(C1.get(), { path: '/', fullPath:'/a/b/c' })
5757
})
5858

5959
test('Children of empty prefix', () => {

0 commit comments

Comments
 (0)