Code Monkey home page Code Monkey logo

hello-ts's Introduction

hello-ts

hello-ts is a simple example repo to show how you can get started with test driven development in TypeScript.

Go has in-line running tests, debugging, and code highlighting baked into their official vscode extension but it turns out most other languages don't have code hightlighting like this by default. This repo shows how you can get started with test driven development in TypeScript with code highlighting in vs-code.

Example screenshot of golang code from poly covered by tests being highlighted green.

I'm not really a JS/TS developer but went down this rabbit hole when exploring vs-code extension development. I was surprised to find that there wasn't a simple way to get code highlighting like this for TypeScript. I'm sure there are other ways to do this but this is the simplest way I found.

Example screenshot of typescript code in this repo covered by tests being highlighted green.

All of the example code we're testing can be found in src and comes from this article by @janis_t on twitter article by @janis_t on twitter.

Install

This assumes you already have npm (or equivalent) and VScode installed

git clone https://github.com/TimothyStiles/hello-ts && cd hello-ts && npm install && code .

Then:

  1. Install the recommended vs-code extensions through the dialogue that should pop up when you first open the project.
  2. Close out the window
  3. Reopen the project with vs-code and extensions installed.
  4. Open src/index.js.
  5. Hit command + s

Now src/index.js should have the code gutters like in the above screenshot.

Other Languages

Sponsor

  • Sponsor: ๐Ÿค˜ Thanks for your support ๐Ÿค˜

License

  • MIT

  • Copyright (c) 2023 Timothy Stiles

hello-ts's People

Contributors

timothystiles avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.