1
0
mirror of https://github.com/kremalicious/astro-redirect-from.git synced 2024-11-22 09:57:03 +01:00

bump vitest to v1.0, nested test fix

This commit is contained in:
Matthias Kretschmann 2023-12-12 21:31:06 +00:00
parent 187a020464
commit d41701a586
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 288 additions and 326 deletions

564
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,24 +26,24 @@
"./dist" "./dist"
], ],
"devDependencies": { "devDependencies": {
"@types/node": "^20.8.8", "@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/eslint-plugin": "^6.14.0",
"@vitest/coverage-v8": "^0.34.6", "@vitest/coverage-v8": "^1.0.4",
"auto-changelog": "^2.4.0", "auto-changelog": "^2.4.0",
"eslint": "^8.50.0", "eslint": "^8.55.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1", "eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.0", "husky": "^8.0.3",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^3.0.3", "prettier": "^3.1.1",
"release-it": "^17.0.0", "release-it": "^17.0.1",
"typescript": "^5.2.2", "typescript": "^5.3.3",
"vite": "^5.0.7", "vite": "^5.0.8",
"vitest": "^0.34.6" "vitest": "^1.0.4"
}, },
"dependencies": { "dependencies": {
"astro": ">= 3", "astro": ">= 3",
"globby": "^13.2.2", "globby": "^14.0.0",
"gray-matter": "^4.0.3" "gray-matter": "^4.0.3"
}, },
"engines": { "engines": {

View File

@ -42,23 +42,23 @@ describe('createRedirect', () => {
'/old-url-1': '/new-url', '/old-url-1': '/new-url',
'/old-url-2': '/new-url' '/old-url-2': '/new-url'
}) })
})
it('should prepend slash everywhere', () => { it('should prepend slash everywhere', () => {
const initialRedirects: Record<string, string> = {} const initialRedirects: Record<string, string> = {}
const redirectFrom = ['old-url-1'] const redirectFrom = ['old-url-1']
let postSlug = '/new-url' let postSlug = '/new-url'
let result = createRedirect(initialRedirects, redirectFrom, postSlug) let result = createRedirect(initialRedirects, redirectFrom, postSlug)
expect(result).toStrictEqual({ expect(result).toStrictEqual({
'/old-url-1': '/new-url' '/old-url-1': '/new-url'
}) })
postSlug = 'new-url' postSlug = 'new-url'
result = createRedirect(initialRedirects, redirectFrom, postSlug) result = createRedirect(initialRedirects, redirectFrom, postSlug)
expect(result).toStrictEqual({ expect(result).toStrictEqual({
'/old-url-1': '/new-url' '/old-url-1': '/new-url'
})
}) })
}) })
}) })