question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rewrite tests in TypeScript

See original GitHub issue

Rewriting the tests in TypeScript should help us further identify places where TypeScript support can be improved.

Steps

  1. Rename a single .test.js to .test.ts
  2. Run npm test to identify errors
  3. Start fixing the errors, making minimal changes to get the tests passing
  4. Repeat step 2-3 until there are no more errors, or until you get stuck and want some extra eyes from someone else in the community
  5. Open a pull request with your changes.

See https://github.com/probot/probot/pull/541 as an example

TODO

  • test/context.test.js (https://github.com/probot/probot/pull/541)
  • test/application.test.js
  • test/github.test.js
  • test/github/graphql.test.js
  • test/index.test.js
  • test/logger.test.js
  • test/middleware/logging.test.js
  • test/apps/default.test.js
  • test/apps/sentry.test.js
  • test/apps/stats.test.js
  • test/private-key.test.js
  • test/resolver.test.js
  • test/serializers.test.js
  • test/server.test.js
  • test/webhook-proxy.test.js

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
macklinucommented, Sep 27, 2018

If I’m not mistaken, all tests have been migrated to TypeScript or have a PR open to migrate them to TypeScript. 💯

0reactions
probotbotcommented, Mar 13, 2019

🎉 This issue has been resolved in version 9.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Unit Tests For A Rewrite: A Case Study - Medium
This blog post series will explore how to write unit tests specifically for rearchitecting or rewriting a project, how to create TypeScript ......
Read more >
Write fewer tests by creating better TypeScript types
Learn how to write better TypeScript types and avoid maintenance and unnecessary changes to code as your app adapts to evolving ...
Read more >
Rewrite in TypeScript #256 - jest-community/eslint-plugin-jest
I've done a first pass of no-mocks-import , which passes all the tests. So far, it seems to me like this'll be a...
Read more >
Better unit tests with TypeScript - ecom.software
According to the results, only 59% of developers write unit tests. It means that a lot of apps we use is not tested...
Read more >
Unit Testing in TypeScript Code | The .NET Tools Blog
Write Unit Tests in TypeScript ... The testing frameworks and the code you want to test must be imported. Import statements belong at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found