Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Building & Testing

Fabian Lauer edited this page May 16, 2016 · 1 revision

Compiling

TSXML uses gulp. The gulpfile is fairly simple and contains the following tasks:

  • cleanup
  • compileSources
  • compileExamples
  • compileDeclarationFile
  • compile
  • compileTests
  • prepareNodeJsRelease
  • prepareRelease

cleanup

Removes the /build and /dist directory. Be careful not to commit without a /dist directory that contains the last known good build.

compileSources

Compiles all files in /src except those in the /src/test directory to JS files in /build/src.

compileExamples

Compiles the files in the /examples directory.

compileDeclarationFile

Compiles a single declaration file from all files in /src (except those in the /src/test directory) and saves it in /build/xml.d.ts.

compile

Compiles all files (except those in the /tests directory) to JavaScript and compiles a single declaration file into /build/xml.d.ts.

compileTests

Compiles all files required to run the test suite. The compiled test runners are located in /build/tests/....

prepareNodeJsRelease

Compiles all files except tests and those in /src/test to the /dist directory and compiles a single declaration file into /dist/xml.d.ts.

prepareRelease

Same as prepareNodeJsRelease, but also concats all compiled JS files into /dist/xml.js, which is capable of running in environments other than node.js.

Testing

To run the test suite, use:

gulp compileTests && node --use-strict --es_staging build/tests/main.js

As of now, there's no way of running just single parts of the test suite.