fix: check failed

Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2023-07-04 16:14:27 +02:00
parent 764d38c9fa
commit 71fd87a716
10 changed files with 10 additions and 22 deletions

View File

@ -12,7 +12,7 @@
"check:astro": "astro check", "check:astro": "astro check",
"check:typescript": "tsc --noEmit", "check:typescript": "tsc --noEmit",
"test": "npm run test:unit && npm run test:integ", "test": "npm run test:unit && npm run test:integ",
"test:unit": "vitest --coverage", "test:unit": "vitest --coverage --run",
"test:integ": "cypress run" "test:integ": "cypress run"
}, },
"dependencies": { "dependencies": {

11
src/env.d.ts vendored
View File

@ -1,5 +1,6 @@
/// <reference path="../.astro/types.d.ts" /> /// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />
/// <reference path="./libs/ResponseBuilder" />
interface ImportMetaEnv { interface ImportMetaEnv {
PRUSASLICER_PATH?: string PRUSASLICER_PATH?: string
@ -20,14 +21,6 @@ declare namespace App {
* authentification key is the api key or the session token * authentification key is the api key or the session token
*/ */
authKey?: string authKey?: string
responseBuilder: { responseBuilder: ResponseBuilder
body(body: string | Buffer | object | null | undefined): this
headers(headers: Record<string, string>): this
addHeader(key: string, value: string): this
addHeaders(headers: Record<string, string>): this
removeHeader(key: string): this
status(status: number): this
build(): Response
} // ./libs/ResponseBuilder object
} }
} }

View File

@ -1,4 +1,3 @@
import { MongoClient } from 'mongodb'
import mongoose from 'mongoose' import mongoose from 'mongoose'
export default class Client { export default class Client {

View File

@ -47,7 +47,6 @@ export default class SessionDao {
}) })
} }
public removeSession(res: ResponseInit & { readonly headers: Headers; }) { public removeSession(_res: ResponseInit & { readonly headers: Headers; }) {
} }
} }

View File

@ -60,7 +60,7 @@ if (!connected && Astro.request.method === 'POST') {
} = load<{connected: boolean}>() } = load<{connected: boolean}>()
if (connected) { if (connected) {
window.location = '/' window.location.pathname = '/'
} }
</script> </script>

View File

@ -1,4 +0,0 @@
---
return Astro.redirect('/account/login?logout')
---

View File

@ -1,4 +1,4 @@
import { afterEach, assert, beforeEach, describe, expect, it, test, vi } from 'vitest' import { describe, expect, it } from 'vitest'
import { getParams } from '../../src/libs/gcodeUtils' import { getParams } from '../../src/libs/gcodeUtils'

View File

@ -1,4 +1,4 @@
import { afterEach, assert, beforeEach, describe, expect, it, test, vi } from 'vitest' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import RateLimiter from '../../src/libs/RateLimiter' import RateLimiter from '../../src/libs/RateLimiter'

View File

@ -1,3 +1,4 @@
{ {
"extends": "./node_modules/astro/tsconfigs/strictest.json" "extends": "./node_modules/astro/tsconfigs/strictest.json",
"exclude": ["cypress"]
} }

View File

@ -1,6 +1,6 @@
/// <reference types="vitest" /> /// <reference types="vitest" />
import { getViteConfig } from 'astro/config' import { getViteConfig } from 'astro/config'
import { configDefaults } from 'vitest/config' // import { configDefaults } from 'vitest/config'
export default getViteConfig({ export default getViteConfig({
test: { test: {