From 5e24097dbff9f0536746226fa5100bb97172f814 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 8 Jun 2017 14:09:23 +0200 Subject: [PATCH] setup ava for running tests --- .travis.yml | 2 +- package.json | 3 ++- test/test.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 test/test.js diff --git a/.travis.yml b/.travis.yml index 2eaf649..739ffef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ node_js: node install: npm install script: - - npm run clean + - npm test - npm run build cache: diff --git a/package.json b/package.json index ba9ff01..d533fa1 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,13 @@ "build:cjs": "cross-env BABEL_ENV=cjs babel ./src -d dist/node", "build:dist": "cross-env NODE_ENV=production webpack -p", "clean": "rimraf dist/bundle dist/node", - "test": "echo \"Error: no test specified AWWWW YEAHHH\" && exit 1", + "test": "ava", "release": "./node_modules/release-it/bin/release.js --src.tagName='v%s' --github.release --npm.publish --non-interactive", "release-minor": "./node_modules/release-it/bin/release.js minor --src.tagName='v%s' --github.release --npm.publish --non-interactive", "release-major": "./node_modules/release-it/bin/release.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive" }, "devDependencies": { + "ava": "^0.19.1", "babel-cli": "^6.22.2", "babel-eslint": "^7.1.1", "babel-loader": "^6.2.10", diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..f9e6f94 --- /dev/null +++ b/test/test.js @@ -0,0 +1,11 @@ +import test from 'ava'; + +test('foo', t => { + t.pass(); +}); + +test('bar', async t => { + const bar = Promise.resolve('bar'); + + t.is(await bar, 'bar'); +});