Giter VIP home page Giter VIP logo

codecept-typescript-example's Introduction

codecept-typescript-example

Example of using codecept.js with typescript.

It was created to be example for users, who has problems with codecept + TS settings.

Used packages:

  • codeceptjs ^2.1.5
  • typescript ^3.4.5
  • ts-lint ^5.16.0
  • ts-node ^8.1.0

Project runs with yarn - it resolves pathes to packages.
If you use npm, then scripts in package.json should be edited, to include path to codeceptjs - ./node_modules/.bin/codeceptjs instead of codeceptjs. Or use npx.

Restrictions

Project was tested on MacOS only. Some problems with paths may occur when run on Windows.

For correct ts-node run environment variable TS_NODE_PROJECT is used. It could be set in CI, or with .env package, for example.

In this repository this evironment variable is created in package.json's scripts section (test:e2e and similar) by linux-shell-command-style definition:

TS_NODE_PROJECT='./src/specs/e2e/tsconfig.json' <some command>

Run on Windows OS

Windows system does not support this style, it uses next command for environment variable setting:

set TS_NODE_PROJECT='./src/specs/e2e/tsconfig.json' codeceptjs run

So, the full script to run in Windows terminal is:

(set TS_NODE_PROJECT=./src/specs/e2e/tsconfig.json) && codeceptjs run

Such script is described in package.json as test:e2e:windows. The same for definitions generation - test:e2e:def:windows .

Links

More information about e2e testing framework on Codecept JS site.
More information about Typescript, it's configuration and examples on Typescript site

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.