cmorten / superoak

HTTP assertions for Oak made easy via SuperDeno. 🐿 🦕
https://cmorten.github.io/superoak/
MIT License
121 stars 8 forks source link

Demo Code Throws Errors #29

Closed marktyers closed 2 years ago

marktyers commented 2 years ago

Issue

When running the demo script it throws four errors.

Setup:

Details

The script was copied from the readme file and named demo.test.ts


$ deno test --allow-net demo.test.ts

error: TS2322 [ERROR]: Type '{}' is not assignable to type 'RouteParams<R>'.
  params: RouteParams<R> = {},
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/oak@v10.0.0/router.ts:223:3

TS2322 [ERROR]: Type '{}' is not assignable to type 'RouteParams<R>'.
  let replace: RouteParams<R> = {};
      ~~~~~~~
    at https://deno.land/x/oak@v10.0.0/router.ts:227:7

TS2322 [ERROR]: Type '{}' is not assignable to type 'RouteParams<R>'.
    existingParams: RouteParams<R> = {},
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/oak@v10.0.0/router.ts:301:5

TS2322 [ERROR]: Type '{}' is not assignable to type 'RouteParams<R>'.
    params: RouteParams<R> = {},
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/oak@v10.0.0/router.ts:321:5

Found 4 errors.
cmorten commented 2 years ago

Hi @marktyers 👋

Thanks for pointing this out! It seems the example was using an out of date version of the oak lib leading to some typescript incompatibility and thus the errors.

I've updated the example and checked it works with the latest version of Deno and this lib.

Feel free to re-open if continue to encounter issues with the new version and example(s)!