diff --git a/package.json b/package.json index 8f32f7f..79f6cc0 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "node": ">=0.10.0" }, "scripts": { - "test": "xo && node test.js" + "test": "xo && ava" }, "files": [ "index.js" @@ -51,7 +51,7 @@ "ansi-regex": "^2.0.0" }, "devDependencies": { - "ava": "0.0.4", + "ava": "*", "xo": "*" } } diff --git a/test.js b/test.js index 1374c50..ba3b695 100644 --- a/test.js +++ b/test.js @@ -1,9 +1,7 @@ -'use strict'; -var test = require('ava'); -var hasAnsi = require('./'); +import test from 'ava'; +import m from './'; -test(function (t) { - t.assert(hasAnsi('foo\u001b[4mcake\u001b[0m')); - t.assert(!hasAnsi('cake')); - t.end(); +test(t => { + t.true(m('foo\u001b[4mcake\u001b[0m')); + t.false(m('cake')); });