typescript-coverage-report icon indicating copy to clipboard operation
typescript-coverage-report copied to clipboard

Bug: unhandled node kind: 262

Open OmgImAlexis opened this issue 4 years ago • 8 comments

Describe the bug While running typescript-coverage-report I get this error, the coverage report still gets generated though.

warning: unhandled node kind: 262

To Reproduce typescript-coverage-report

Expected behaviour No error.

Environment

  • Tool version: 0.1.3
  • OS: MacOS
  • Node version: 13

Additional context

➜  scratch git:(master) ✗ npm run coverage                                            

> [email protected] coverage /Users/xo/code/scratchdb/scratch
> typescript-coverage-report

warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
warning: unhandled node kind: 262
┌─────────────────────────────────────────┬──────────────────┬──────────────┬────────────────┬────────────────┐
│ filenames (43)                          │ percent (95.84%) │ total (2185) │ covered (2094) │ uncovered (91) │
│ ---                                     │              --- │          --- │            --- │            --- │
│ app/log/logger.ts                       │           95.86% │          169 │            162 │              7 │
│ app/log/logger-middleware.ts            │          100.00% │          121 │            121 │              0 │
│ app/log/index.ts                        │          100.00% │            0 │              0 │              0 │
│ app/utils/generate-relative-path.ts     │          100.00% │           15 │             15 │              0 │
│ app/utils/index.ts                      │          100.00% │            2 │              2 │              0 │
│ app/config.ts                           │           93.63% │          204 │            191 │             13 │
│ types.d.ts                              │          100.00% │          105 │            105 │              0 │
│ app/database.ts                         │           89.29% │           28 │             25 │              3 │
│ app/api/episode.ts                      │          100.00% │           28 │             28 │              0 │
│ app/api/history.ts                      │          100.00% │           28 │             28 │              0 │
│ app/api/show.ts                         │          100.00% │           28 │             28 │              0 │
│ app/api/index.ts                        │          100.00% │            0 │              0 │              0 │
│ app/errors/app-error.ts                 │          100.00% │           34 │             34 │              0 │
│ app/errors/invalid-result-type-error.ts │          100.00% │           15 │             15 │              0 │
│ app/errors/index.ts                     │          100.00% │            0 │              0 │              0 │
│ app/worker.ts                           │           91.06% │          246 │            224 │             22 │
│ app/workers.ts                          │           81.88% │          160 │            131 │             29 │
│ app/index.ts                            │          100.00% │           17 │             17 │              0 │
│ app/indexers/thetvdb.ts                 │          100.00% │           30 │             30 │              0 │
│ app/indexers/tvmaze.ts                  │          100.00% │            7 │              7 │              0 │
│ app/indexers/index.ts                   │          100.00% │            0 │              0 │              0 │
│ app/processors/music/song.ts            │          100.00% │           13 │             13 │              0 │
│ app/processors/music/index.ts           │          100.00% │            0 │              0 │              0 │
│ app/processors/show/episode.ts          │          100.00% │           47 │             47 │              0 │
│ app/processors/show/index.ts            │          100.00% │            0 │              0 │              0 │
│ app/processors/index.ts                 │          100.00% │            0 │              0 │              0 │
│ app/processors/movie/movie.ts           │          100.00% │           22 │             22 │              0 │
│ app/processors/movie/index.ts           │          100.00% │            0 │              0 │              0 │
│ app/routes/episode.ts                   │          100.00% │           16 │             16 │              0 │
│ app/routes/history.ts                   │          100.00% │           16 │             16 │              0 │
│ app/routes/search.ts                    │           95.45% │           66 │             63 │              3 │
│ app/routes/show.ts                      │           98.55% │           69 │             68 │              1 │
│ app/routes/worker.ts                    │           97.56% │           82 │             80 │              2 │
│ app/routes/index.ts                     │          100.00% │           10 │             10 │              0 │
│ app/router.ts                           │          100.00% │           20 │             20 │              0 │
│ app/routes/error-handler.ts             │          100.00% │           44 │             44 │              0 │
│ app/routes/not-found-handler.ts         │          100.00% │           23 │             23 │              0 │
│ app/workers/post-processor.ts           │           96.03% │          277 │            266 │             11 │
│ app/workers/show-update.ts              │          100.00% │           32 │             32 │              0 │
│ app/workers/web-server.ts               │          100.00% │          147 │            147 │              0 │
│ test/app.test.ts                        │          100.00% │            7 │              7 │              0 │
│ test/log.test.ts                        │          100.00% │           46 │             46 │              0 │
│ types/index.ts                          │          100.00% │           11 │             11 │              0 │
└─────────────────────────────────────────┴──────────────────┴──────────────┴────────────────┴────────────────┘
View generated HTML Report at /Users/xo/code/scratchdb/scratch/coverage-ts/index.html

OmgImAlexis avatar May 18 '20 05:05 OmgImAlexis

Interesting. I'll have a look :) Thanks for reporting.

alexcanessa avatar May 18 '20 08:05 alexcanessa

If there's anything I can do to provide better logs let me know.

OmgImAlexis avatar May 18 '20 08:05 OmgImAlexis

@OmgImAlexis I'm struggling to replicate this bug.

Are you able to provide a link to your repo or create a sandbox that replicates this?

alexcanessa avatar Nov 08 '20 12:11 alexcanessa

I think this is the same issue as before. I've actually got a decent log this time though and it pointed me to this line.

this.lock ??= new Mutex();

More specifically the ??= part which I'm guessing this doesn't support yet?

OmgImAlexis avatar Jul 12 '21 03:07 OmgImAlexis

@OmgImAlexis where is that line?

alexcanessa avatar Jul 14 '21 10:07 alexcanessa

Make a new file. Add anything using the ??= operator and run it. You'll see the issue.

OmgImAlexis avatar Jul 14 '21 11:07 OmgImAlexis

Getting the same issue but with a different code this time. 76 instead of 262.

warning: unhandled node kind: 76 in app/core/api-manager.ts:372:13

The offending line.

	private async getLock() {
		this.lock ??= new Mutex();
		return this.lock;
	}

OmgImAlexis avatar Aug 30 '21 04:08 OmgImAlexis

@alexcanessa can we get type-coverage updated to v2.18.2?

https://github.com/plantain-00/type-coverage/issues/99#issuecomment-908290197 shows it fixed.

OmgImAlexis avatar Sep 26 '21 20:09 OmgImAlexis