gas-test
v0.5.1
Published
Simple test framework for Google Apps Script
Downloads
42
Readme
gas-test
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