gas-test
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

gas-test NPM version Build Status

Simple test framework for Google Apps Script

gas-test is test framework running on Google Apps Script runtime.

Installation

First, install gas-test using npm (we assume you have pre-installed node.js).

npm install gas-test --save-dev

Usage

app.js:

const assert = require('assert');
const Tests = require('gas-unit');
const t = new Tests();
const suite = t.suite.bind(t);
const test = t.test.bind(t);
 
global.run = function run() {
  t.runAll();
}
 
suite('abc test suite', () => {
  test('abc test', () => {
    // assertion false
    assert.equal('abc', 'abx');
  });
});

XUnit XML report

const assert = require('assert');
const Tests = require('gas-unit');
const t = new Tests('xunit'); // use xunit reporter.
const suite = t.suite.bind(t);
const test = t.test.bind(t);
 
global.run = function run() {
  t.runAll();
  return t.reporter.result;
}

Example

Demo can be found in the example directory.

License

MIT © fossamagna

Package Sidebar

Install

npm i gas-test

Weekly Downloads

3

Version

0.5.1

License

MIT

Unpacked Size

111 kB

Total Files

37

Last publish

Collaborators

  • fossamagna