Maxim-Mazurok/google-api-typings-generator

Remove TS version

Maxim-Mazurok opened this issue · 3 comments

// TypeScript Version: 2.8

when you have time, please consider updating this, as it has no longer any value here on DT ecosystem, thanks!

Originally posted by @peterblazejewicz in DefinitelyTyped/DefinitelyTyped#62195 (comment)

Basically, just remove // TypeScript Version: 2.8 from all *.dot template files, update snapshots and that's pretty much it.

UPDATE remove writer.writeLine('// TypeScript Version: 2.8'); from app.ts as well

Basically, just remove // TypeScript Version: 2.8 from all *.dot template files, update snapshots and that's pretty much it.

How do you update snapshots?

npm run start-dt then manually copy types from ~/DefinitelyTyped/types?
Thanks!

Not quite, there are two snapshotting mechanisms in this project:

  1. https://github.com/mochiya98/mocha-chai-jest-snapshot/ is used for test/templates.spec.ts
  2. In test/restDocs/test.spec.ts we have our own implementation, see mySnapshotTest

Both of them should update shapshots when --update switch is present when running tests.

mySnapshotTest currently only works on linux (or you can use WSL on windows) and need these commands installed: diff (or colordiff) and print.
diff is shipped with git, so you probably already have it.
print can be installed like so in ubuntu: sudo apt install mailcap

This is a temporary solution and we probably need to use the 1st approach everywhere, here is an issue to do that: #705
It might make sense to implement it first if you'll have trouble running these tests.

So TL;DR, you can run npm run test:unit -- --update to update snapshots.