Skip to content

Commit

Permalink
Ensure test-unit includes package unit tests (#46707)
Browse files Browse the repository at this point in the history
Seems the unit tests from our packages haven't been running as a few haven't been updated and had failing assertions.
  • Loading branch information
ijjk authored Mar 2, 2023
1 parent 4e54429 commit ed6cd41
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lerna": "lerna",
"dev": "turbo run dev --parallel",
"test-types": "tsc",
"test-unit": "jest test/unit/",
"test-unit": "jest test/unit/ packages/next/ packages/font",
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
"test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
"test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,9 @@ describe('navigateReducer', () => {
],
},
// TODO-APP: optimistic tree is wrong
// undefined,
// undefined,
// true,
undefined,
undefined,
true,
],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ describe('RouteHandlerManager', () => {
}

expect(await handlers.handle(route, req, res)).toEqual(true)
expect(handler.handle).toHaveBeenCalledWith(route, req, res)
expect(handler.handle).toHaveBeenCalledWith(
route,
req,
res,
undefined,
undefined
)
})

it('will throw when multiple handlers are added for the same type', () => {
Expand Down Expand Up @@ -95,7 +101,13 @@ describe('RouteHandlerManager', () => {
}

expect(await handlers.handle(route, req, res)).toEqual(true)
expect(goodHandler.handle).toBeCalledWith(route, req, res)
expect(goodHandler.handle).toBeCalledWith(
route,
req,
res,
undefined,
undefined
)
expect(badHandler.handle).not.toBeCalled()
})
})

0 comments on commit ed6cd41

Please sign in to comment.