Browse Source

Fix failing tests on `master` branch (#469)

* remove "always-include-main" test case

It was testing for incorrect behavior that has now been fixed.

See: https://github.com/zeit/now-cli/pull/464

* remove "files" array from `main` related test cases

Makes these three tests pass once again.

* always run a test for "pack-now" even when not in CI

Otherwise `ava` fails because the test did not
run any assertions.
master 5.0.0
Nathan Rajlich 8 years ago
committed by Matheus Fernandes
parent
commit
5a295017ec
  1. 1
      test/_fixtures/always-include-main/a.js
  2. 1
      test/_fixtures/always-include-main/b.js
  3. 10
      test/_fixtures/always-include-main/package.json
  4. 1
      test/_fixtures/always-include-main/woot.js
  5. 1
      test/_fixtures/directory-main/package.json
  6. 1
      test/_fixtures/extensionless-main/package.json
  7. 1
      test/_fixtures/simple-main/package.json
  8. 9
      test/index.js
  9. 10
      test/pack-now.js

1
test/_fixtures/always-include-main/a.js

@ -1 +0,0 @@
// should be included

1
test/_fixtures/always-include-main/b.js

@ -1 +0,0 @@
// should NOT be included

10
test/_fixtures/always-include-main/package.json

@ -1,10 +0,0 @@
{
"name": "should-include-main",
"version": "0.0.1",
"description": "",
"main": "a.js",
"files": [
"woot.js"
],
"dependencies": {}
}

1
test/_fixtures/always-include-main/woot.js

@ -1 +0,0 @@
// should be included

1
test/_fixtures/directory-main/package.json

@ -3,6 +3,5 @@
"version": "0.0.1",
"description": "",
"main": "./a",
"files": ["build/a.js"],
"dependencies": {}
}

1
test/_fixtures/extensionless-main/package.json

@ -3,6 +3,5 @@
"version": "0.0.1",
"description": "",
"main": "./index",
"files": ["build/a.js"],
"dependencies": {}
}

1
test/_fixtures/simple-main/package.json

@ -3,6 +3,5 @@
"version": "0.0.1",
"description": "",
"main": "./index.js",
"files": ["build/a.js"],
"dependencies": {}
}

9
test/index.js

@ -139,15 +139,6 @@ test('ignore nested `node_modules` with .npmignore **', async t => {
t.is(base(files[1]), 'nested-node_modules/package.json');
});
test('include `main` even if not in files', async t => {
let files = await getNpmFiles(fixture('always-include-main'));
files = files.sort(alpha);
t.is(files.length, 3);
t.is(base(files[0]), 'always-include-main/a.js');
t.is(base(files[1]), 'always-include-main/package.json');
t.is(base(files[2]), 'always-include-main/woot.js');
});
test('support whitelisting with .npmignore and !', async t => {
let files = await getNpmFiles(fixture('negation'));
files = files.sort(alpha);

10
test/pack-now.js

@ -5,7 +5,10 @@ const test = require('ava');
const logo = require('../lib/utils/output/logo');
test.serial('make binary', async t => {
if (!process.env.CI) return; // eslint-disable-line curly
if (!process.env.CI) {
t.true(true);
return;
}
const result = await spawn('npm', ['run', 'pack']);
t.is(result.code, 0);
});
@ -20,7 +23,10 @@ const binaryPath = path.resolve(__dirname, '../packed/' + binary);
const deployHelpMessage = `${logo} now [options] <command | path>`;
test.serial('packed "now help" prints deploy help message', async t => {
if (!process.env.CI) return; // eslint-disable-line curly
if (!process.env.CI) {
t.true(true);
return;
}
const result = await spawn(binaryPath, ['help']);
t.is(result.code, 0);

Loading…
Cancel
Save