mirror of
https://gitlab.com/nightlycommit/twing.git
synced 2025-01-18 08:46:50 +02:00
First-class Twig engine for Node.js
cdeb823b73
Resolve Issue #610 - Make Twing easier on bundlers loaders/plugins creators See merge request nightlycommit/twing!601 |
||
---|---|---|
src | ||
test | ||
.editorconfig | ||
.gitignore | ||
.nycrc.json | ||
LICENSE | ||
package.json | ||
README.md | ||
tsconfig.json |
Twing
First-class TypeScript and JavaScript Twig compiler
Prerequisites
This projects needs at least node.js 16.0.0 to run.
It is also strongly recommended to have ts-node and nyc installed globally to ease the writing of tests and the tracking of the code coverage.
Usage
Installation
npm install
Build the library
npm run build
Build and run the test suite
npm run build:test
npm run test
Build and run the test suite in a browser
npm run build:test
npm run test:browser
Writing and executing tests
Assuming one want to execute the test located in test/tests/integration/comparison/to-array.ts
, one would run:
ts-node test/tests/integration/comparison/to-array.ts
It is even possible - and recommended - to track the coverage while writing tests:
nyc ts-node test/tests/integration/comparison/to-array.ts
Of course, it is also perfectly possible to pipe the result of the test to your favorite tap formatter:
test/tests/integration/comparison$ ts-node . | tap-nyan
9 -_-_-_-_-_,------,
0 -_-_-_-_-_| /\_/\
0 -_-_-_-_-^|__( ^ .^)
-_-_-_-_- "" ""
Pass!
Contributing
- Fork this repository
- Code
- Implement tests using tape
- Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
License
Copyright © 2018-2023 Eric MORAND. Released under the 2-Clause BSD License.