Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Clean up package.json, make version regex a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Sep 25, 2018
1 parent 694f283 commit 00f2354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"watch": "rm -rf lib && node_modules/babel-cli/bin/babel.js --watch src -d lib --copy-files",
"lint": "node_modules/.bin/eslint zapier.js src",
"lint-snippets": "node_modules/.bin/eslint snippets --rule 'no-unused-vars: 0' --ignore-pattern snippets/next.js",
"test": "npm run build && NODE_ENV=test node_modules/mocha/bin/mocha -t 30000 --recursive lib/tests && npm run lint && npm run lint-snippets",
"smoke-test": "npm run build && NODE_ENV=test node_modules/mocha/bin/mocha -t 30000 --recursive lib/smoke-tests",
"pretest": "npm run build",
"test": "NODE_ENV=test mocha -t 30000 --recursive lib/tests && npm run lint && npm run lint-snippets",
"smoke-test": "npm run build && NODE_ENV=test mocha -t 30000 --recursive lib/smoke-tests",
"zapier": "zapier.js",
"validate-templates": "./scripts/validate-app-templates.js",
"set-template-versions": "./scripts/set-app-template-versions.js",
Expand Down
6 changes: 3 additions & 3 deletions src/smoke-tests/smoke-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const path = require('path');
require('should');
const fetch = require('node-fetch');

const REGEX_VERSION = /\d+\.\d+\.\d+/;

const setupZapierRC = () => {
let hasRC = false;
if (process.env.DEPLOY_KEY) {
Expand Down Expand Up @@ -70,9 +72,7 @@ describe('smoke tests - setup will take some time', () => {
context.hasRC = setupZapierRC();

context.package.filename = npmPack();
context.package.version = context.package.filename.match(
/\d+\.\d+\.\d+/
)[0];
context.package.version = context.package.filename.match(REGEX_VERSION)[0];
context.package.path = path.join(process.cwd(), context.package.filename);

context.workdir = setupTempWorkingDir();
Expand Down

0 comments on commit 00f2354

Please sign in to comment.