Savory / Danet-Starter

A basic Danet app to help you build awesome API
MIT License
5 stars 3 forks source link

test failed (spec) #2

Closed elycheikhsmail closed 1 year ago

elycheikhsmail commented 1 year ago

I'm using
deno 1.26.0 (release, x86_64-unknown-linux-gnu) v8 10.7.193.3 typescript 4.8.3

, I run deno task test, I get the following

 deno task test
Warning deno task is unstable and may drastically change in the future
Task test NO_LOG=true deno test --allow-env --allow-net --allow-read -A --unstable spec
Check file:///home/ely/Documents/test-and-learn/Danet-Starter-main/spec/todo.test.ts
error: TS2740 [ERROR]: Type 'Promise<TodoService>' is missing the following properties from type 'TodoService': todos, getAll, getById, create, and 3 more.
    todoService =  app.get<TodoService>(TodoService) ;
    ~~~~~~~~~~~
    at file:///home/ely/Documents/test-and-learn/Danet-Starter-main/spec/todo.test.ts:32:5

I try add "await" like this :


    todoService =  await app.get<TodoService>(TodoService) ;

I fix the syntaxe error the test still fail, in fact the todoService still undefind after this

todoService =  await app.get<TodoService>(TodoService) ;
Sorikairox commented 1 year ago

Fixed