Permalink
Browse files

moves from tap to ava

  • Loading branch information...
Simone Lusenti
Simone Lusenti committed Feb 3, 2017
1 parent c2c2935 commit 124a4626a99a705ae3666cab64b3e78a97793b43
View
@@ -4,5 +4,6 @@
],
"presets": [
["env", { "targets": { "node": 6 } }]
]
],
"sourceMaps": "inline"
}
View
@@ -7,14 +7,15 @@
"scripts": {
"clean": "rm -rf dist/",
"compile": "babel -s true --source-maps inline -d dist/ src/ --ignore *.AppleDouble*",
"coverage": "tap --nyc-arg=--require --nyc-arg=babel-register src/**/*.spec.js --cov --coverage-report=html",
"link:watch": "nodemon -w src -x npm -- run lint-link",
"format": "prettier-eslint --write src/**/*.js | snazzy",
"lint": "npm run format",
"lint-link": "npm run lint && npm link",
"lint:watch": "nodemon -w src -x npm -- run lint",
"prepublish": "npm run clean && npm run compile",
"test": "npm run lint && tap --nyc-arg=--require --nyc-arg=babel-register src/**/*.spec.js --check-coverage --lines 0"
"pre-commit": "npm run lint",
"coverage-report": "nyc report --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter=lcov",
"test": "nyc ava src/**/*.spec.js && npm run coverage-report"
},
"engines": {
"node": ">=6"
@@ -49,14 +50,14 @@
"prop-types": "^0.2.0",
"send": "^0.14.1",
"source-map-support": "^0.4.6",
"tap": "^10.0.0",
"temp": "^0.8.3",
"update-notifier": "^1.0.2",
"yargs": "^6.0.0",
"zen-observable": "^0.4.0"
},
"bin": "dist/index.js",
"devDependencies": {
"ava": "^0.18.0",
"babel-cli": "^6.14.0",
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-preset-env": "^1.1.4",
@@ -66,8 +67,20 @@
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"nyc": "^10.1.2",
"pre-commit": "^1.2.2",
"prettier-eslint-cli": "^1.1.0",
"snazzy": "^6.0.0"
},
"ava": {
"require": [
"babel-register"
]
},
"nyc": {
"require": [
"babel-register"
],
"sourceMap": true
}
}
@@ -1,6 +1,6 @@
/* eslint unused: 0 */
import { test } from 'tap';
import test from 'ava';
import sortObject from 'deep-sort-object';
import {
@@ -72,7 +72,6 @@ test('templateRest', t => {
sortObject(actual),
'should return a rest api template'
);
t.end();
});
test('templateResource', t => {
@@ -108,7 +107,6 @@ test('templateResource', t => {
},
'should return a resource template, which references the given parentResourceName as parent'
);
t.end();
});
test('templateResourceHelper', t => {
@@ -135,7 +133,6 @@ test('templateResourceHelper', t => {
};
const actual = templateResourceHelper({ resourcePath: 'foo/bar' });
t.deepEqual(sortObject(expected), sortObject(actual));
t.end();
});
test('templateResourceHelper with named params', t => {
@@ -162,7 +159,6 @@ test('templateResourceHelper with named params', t => {
};
const actual = templateResourceHelper({ resourcePath: 'foo/{bar}' });
t.deepEqual(sortObject(expected), sortObject(actual));
t.end();
});
test('templateResourceHelper with empty path', t => {
@@ -172,7 +168,6 @@ test('templateResourceHelper with empty path', t => {
};
const actual = templateResourceHelper({ resourcePath: '' });
t.deepEqual(sortObject(expected), sortObject(actual));
t.end();
});
test('templateModel', t => {
@@ -189,7 +184,6 @@ test('templateModel', t => {
};
const actual = templateModel({ modelName: 'CustomResponse', modelSchema: {} });
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateLambdaIntegration with custom ContentType', t => {
@@ -276,7 +270,6 @@ $errorMessageObj.response`
redirects: false
});
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateLambdaIntegration with ContentType = application/json', t => {
@@ -353,7 +346,6 @@ $inputRoot.response`
redirects: false
});
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateLambdaIntegration with redirect = true', t => {
@@ -438,7 +430,6 @@ You are being redirected to $inputRoot.response.Location`
redirects: true
});
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateMethod with an authorizer', t => {
@@ -590,7 +581,6 @@ $errorMessageObj.response`
redirects: false
});
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateMethod without an authorizer', t => {
@@ -715,7 +705,6 @@ $inputRoot.response`
redirects: false
});
t.deepEqual(sortObject(expected), sortObject(actual), 'should return');
t.end();
});
test('templateDeployment', t => {
@@ -740,7 +729,6 @@ test('templateDeployment', t => {
sortObject(actual),
'should return the deployment template'
);
t.end();
});
test('templateStage', t => {
@@ -770,7 +758,6 @@ test('templateStage', t => {
sortObject(actual),
'should return the stage template'
);
t.end();
});
test('templateAccount', t => {
@@ -807,7 +794,6 @@ test('templateAccount', t => {
sortObject(actual),
'should return the stage template'
);
t.end();
});
test('templateCloudWatchRole', t => {
@@ -838,7 +824,6 @@ test('templateCloudWatchRole', t => {
expected,
'should return an API Gateway role with push access to CloudWatch Logs'
);
t.end();
});
test('templateAuthorizer', t => {
@@ -863,5 +848,4 @@ test('templateAuthorizer', t => {
actual,
'should return an API Gateway Authorizer template'
);
t.end();
});
@@ -1,6 +1,6 @@
/* eslint no-unused-vars: 0 */
import { test } from 'tap';
import test from 'ava';
import { templateCloudfrontDistribution } from './cf_cloudfront';
@@ -113,7 +113,6 @@ test('templateCloudfrontDistribution without WebACL', t => {
cloudfrontRootOrigin: 'api'
});
t.deepEqual(actual, expected);
t.end();
});
test('templateCloudfrontDistribution without aliases', t => {
@@ -218,7 +217,6 @@ test('templateCloudfrontDistribution without aliases', t => {
cloudfrontRootOrigin: 'api'
});
t.deepEqual(expected, actual);
t.end();
});
test('templateCloudfrontDistribution with root origin set to assets', t => {
@@ -336,7 +334,6 @@ test('templateCloudfrontDistribution with root origin set to assets', t => {
cloudfrontRootOrigin: 'assets'
});
t.deepEqual(expected, actual);
t.end();
});
test('templateCloudfrontDistribution with WebACL', t => {
@@ -460,5 +457,4 @@ test('templateCloudfrontDistribution with WebACL', t => {
});
process.env.NODE_ENV = oldEnv;
t.deepEqual(actual, expected);
t.end();
});
@@ -1,4 +1,4 @@
import { test } from 'tap';
import test from 'ava';
import { templateLambda, templateLambdaExecutionRole } from './cf_lambda';
@@ -73,7 +73,6 @@ test('templateLambdaExecutionRole', t => {
expected,
'should return an execution role with the specified statements'
);
t.end();
});
test('templateLambda', t => {
@@ -178,7 +177,6 @@ test('templateLambda', t => {
environment: { myBar: 'baz' }
});
t.deepEqual(expected, actual, 'should return a lambda template');
t.end();
});
test('templateLambda in production', t => {
@@ -283,7 +281,6 @@ test('templateLambda in production', t => {
});
process.env.NODE_ENV = oldEnv;
t.deepEqual(actual, expected, 'should return a lambda template');
t.end();
});
test('templateLambda with inline codes', t => {
@@ -380,5 +377,4 @@ test('templateLambda with inline codes', t => {
)
});
t.deepEqual(expected, actual, 'should return a lambda template');
t.end();
});
@@ -1,6 +1,6 @@
/* eslint no-unused-vars: 0 */
import { test } from 'tap';
import test from 'ava';
import { templateRoute53 } from './cf_route53';
@@ -24,6 +24,5 @@ test('templateRoute53', t => {
hostedZoneId: 'XXX',
cloudfrontCustomDomain: 'bar.com'
});
t.assert(expected, actual);
t.end();
t.deepEqual(expected, actual);
});
@@ -1,12 +1,11 @@
import { test } from 'tap';
import test from 'ava';
import { templateAssetsBucket, templateAssetsBucketName } from './cf_s3';
test('templateAssetsBucketName', t => {
const expected = 'BucketAssets';
const actual = templateAssetsBucketName();
t.equal(actual, expected, 'should return BucketAssets');
t.end();
t.deepEqual(actual, expected, 'should return BucketAssets');
});
test('templateAssetsBucket', t => {
@@ -23,5 +22,4 @@ test('templateAssetsBucket', t => {
};
const actual = templateAssetsBucket();
t.deepEqual(actual, expected, 'should return an S3 Bucket template');
t.end();
});
@@ -1,14 +1,13 @@
/* eslint no-unused-vars: 0 */
import { test } from 'tap';
import test from 'ava';
import { templateSupportBucketName, templateSupportStack } from './cf_support';
test('templateSupportBucketName', t => {
const expected = 'BucketSupport';
const actual = templateSupportBucketName();
t.equal(actual, expected);
t.end();
t.deepEqual(actual, expected);
});
test('templateSupportStack', t => {
@@ -30,5 +29,4 @@ test('templateSupportStack', t => {
};
const actual = templateSupportStack();
t.deepEqual(actual, expected);
t.end();
});
@@ -1,6 +1,6 @@
/* eslint no-unused-vars: 0 */
import { test } from 'tap';
import test from 'ava';
import createIndex from './createIndex';
@@ -119,5 +119,4 @@ return callback(null, data);
config.myEventHandler.api = { path: false };
const actual = createIndex(config, 'barapp');
t.deepEqual(expected, actual);
t.end();
});
Oops, something went wrong.

0 comments on commit 124a462

Please sign in to comment.