Skip to content

Commit

Permalink
Merge branch 'issue/2383'
Browse files Browse the repository at this point in the history
* issue/2383:
  rename more fixtures; closes #2383
  fix test files not using .spec suffix fix test fixtures not using .fixture suffix
  • Loading branch information
boneskull committed Sep 19, 2016
2 parents 1786fe2 + 93e9fc9 commit 9e7f5f2
Show file tree
Hide file tree
Showing 124 changed files with 86 additions and 84 deletions.
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,31 @@ test-requires:
--require test/acceptance/require/b.coffee \
--require test/acceptance/require/c.js \
--require test/acceptance/require/d.coffee \
test/acceptance/require/require.js
test/acceptance/require/require.spec.js

test-bdd:
@printf "==> [Test :: BDD]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui bdd \
test/acceptance/interfaces/bdd
test/acceptance/interfaces/bdd.spec

test-tdd:
@printf "==> [Test :: TDD]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui tdd \
test/acceptance/interfaces/tdd
test/acceptance/interfaces/tdd.spec

test-qunit:
@printf "==> [Test :: QUnit]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui qunit \
test/acceptance/interfaces/qunit
test/acceptance/interfaces/qunit.spec

test-exports:
@printf "==> [Test :: Exports]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui exports \
test/acceptance/interfaces/exports
test/acceptance/interfaces/exports.spec

test-glob:
@printf "==> [Test :: Glob]\n"
Expand All @@ -120,29 +120,29 @@ test-only:
@printf "==> [Test :: Only]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui tdd \
test/acceptance/misc/only/tdd
test/acceptance/misc/only/tdd.spec

$(MOCHA) --reporter $(REPORTER) \
--ui bdd \
test/acceptance/misc/only/bdd
test/acceptance/misc/only/bdd.spec

$(MOCHA) --reporter $(REPORTER) \
--ui qunit \
test/acceptance/misc/only/bdd-require
test/acceptance/misc/only/bdd-require.spec

test-global-only:
@printf "==> [Test :: Global Only]\n"
$(MOCHA) --reporter $(REPORTER) \
--ui tdd \
test/acceptance/misc/only/global/tdd
test/acceptance/misc/only/global/tdd.spec

$(MOCHA) --reporter $(REPORTER) \
--ui bdd \
test/acceptance/misc/only/global/bdd
test/acceptance/misc/only/global/bdd.spec

$(MOCHA) --reporter $(REPORTER) \
--ui qunit \
test/acceptance/misc/only/global/qunit
test/acceptance/misc/only/global/qunit.spec

test-mocha:
@printf "==> [Test :: Mocha]\n"
Expand All @@ -152,19 +152,19 @@ test-mocha:
non-tty:
@printf "==> [Test :: Non-TTY]\n"
$(MOCHA) --reporter dot \
test/acceptance/interfaces/bdd 2>&1 > /tmp/dot.out
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/dot.out

@echo dot:
@cat /tmp/dot.out

$(MOCHA) --reporter list \
test/acceptance/interfaces/bdd 2>&1 > /tmp/list.out
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/list.out

@echo list:
@cat /tmp/list.out

$(MOCHA) --reporter spec \
test/acceptance/interfaces/bdd 2>&1 > /tmp/spec.out
test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/spec.out

@echo spec:
@cat /tmp/spec.out
Expand Down
16 changes: 9 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ module.exports = function(config) {
'mocha'
],
files: [
'test/browser-fixtures/bdd.js',
'test/acceptance/*.js'
// we use the BDD interface for all of the tests that
// aren't interface-specific.
'test/browser-fixtures/bdd.fixture.js',
'test/acceptance/*.spec.js'
],
exclude: [
'test/acceptance/http.js',
'test/acceptance/fs.js',
'test/acceptance/lookup-files.js',
'test/acceptance/http.spec.js',
'test/acceptance/fs.spec.js',
'test/acceptance/lookup-files.spec.js',
'test/acceptance/require/**/*.js',
'test/acceptance/misc/**/*.js'
],
Expand Down Expand Up @@ -108,8 +110,8 @@ module.exports = function(config) {
cfg.sauceLabs.testName = 'Interface "' + ui + '" integration tests';
}
cfg.files = [
'test/browser-fixtures/' + ui + '.js',
'test/acceptance/interfaces/' + ui + '.js'
'test/browser-fixtures/' + ui + '.fixture.js',
'test/acceptance/interfaces/' + ui + '.spec.js'
];
} else if (cfg.sauceLabs) {
cfg.sauceLabs.testName = 'Unit Tests';
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis-before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

npm install --production
# this avoids our mocha.opts (and thus devDependencies) in a roundabout way
./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.js
./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.spec.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('diffs', function() {
var diffs, expected;

before(function(done) {
run('diffs/diffs.js', ['-C'], function(err, res) {
run('diffs/diffs.fixture.js', ['-C'], function(err, res) {
expected = getExpectedOutput();
diffs = getDiffs(res.output);
done(err);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions test/integration/hook.err.js → test/integration/hook-err.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('hook error handling', function() {
var lines;

describe('before hook error', function() {
before(run('hooks/before.hook.error.js'));
before(run('hooks/before-hook-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -17,7 +17,7 @@ describe('hook error handling', function() {
});

describe('before hook error tip', function() {
before(run('hooks/before.hook.error.tip.js', onlyErrorTitle));
before(run('hooks/before-hook-error-tip.fixture.js', onlyErrorTitle));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -27,7 +27,7 @@ describe('hook error handling', function() {
});

describe('before each hook error', function() {
before(run('hooks/beforeEach.hook.error.js'));
before(run('hooks/beforeEach-hook-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -37,7 +37,7 @@ describe('hook error handling', function() {
});

describe('after hook error', function() {
before(run('hooks/after.hook.error.js'));
before(run('hooks/after-hook-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -47,7 +47,7 @@ describe('hook error handling', function() {
});

describe('after each hook error', function() {
before(run('hooks/afterEach.hook.error.js'));
before(run('hooks/afterEach-hook-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -57,7 +57,7 @@ describe('hook error handling', function() {
});

describe('multiple hook errors', function() {
before(run('hooks/multiple.hook.error.js'));
before(run('hooks/multiple-hook-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('hook error handling', function() {
});

describe('async - before hook error', function() {
before(run('hooks/before.hook.async.error.js'));
before(run('hooks/before-hook-async-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -105,7 +105,7 @@ describe('hook error handling', function() {
});

describe('async - before hook error tip', function() {
before(run('hooks/before.hook.async.error.tip.js', onlyErrorTitle));
before(run('hooks/before-hook-async-error-tip.fixture.js', onlyErrorTitle));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -115,7 +115,7 @@ describe('hook error handling', function() {
});

describe('async - before each hook error', function() {
before(run('hooks/beforeEach.hook.async.error.js'));
before(run('hooks/beforeEach-hook-async-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -125,7 +125,7 @@ describe('hook error handling', function() {
});

describe('async - after hook error', function() {
before(run('hooks/after.hook.async.error.js'));
before(run('hooks/after-hook-async-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -135,7 +135,7 @@ describe('hook error handling', function() {
});

describe('async - after each hook error', function() {
before(run('hooks/afterEach.hook.async.error.js'));
before(run('hooks/afterEach-hook-async-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand All @@ -145,7 +145,7 @@ describe('hook error handling', function() {
});

describe('async - multiple hook errors', function() {
before(run('hooks/multiple.hook.async.error.js'));
before(run('hooks/multiple-hook-async-error.fixture.js'));
it('should verify results', function() {
assert.deepEqual(
lines,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var args = [];

describe('hooks', function() {
it('are ran in correct order', function(done) {
run('cascade.js', args, function(err, res) {
run('cascade.fixture.js', args, function(err, res) {
var lines, expected;

assert(!err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('multiple calls to done()', function() {
var res;
describe('from a spec', function() {
before(function(done) {
run('multiple.done.js', args, function(err, result) {
run('multiple-done.fixture.js', args, function(err, result) {
res = result;
done(err);
});
Expand All @@ -27,7 +27,7 @@ describe('multiple calls to done()', function() {

describe('with multiple specs', function() {
before(function(done) {
run('multiple.done.specs.js', args, function(err, result) {
run('multiple-done-specs.fixture.js', args, function(err, result) {
res = result;
done(err);
});
Expand All @@ -49,7 +49,7 @@ describe('multiple calls to done()', function() {

describe('from a before hook', function() {
before(function(done) {
run('multiple.done.before.js', args, function(err, result) {
run('multiple-done-before.fixture.js', args, function(err, result) {
res = result;
done(err);
});
Expand All @@ -71,7 +71,7 @@ describe('multiple calls to done()', function() {

describe('from a beforeEach hook', function() {
before(function(done) {
run('multiple.done.beforeEach.js', args, function(err, result) {
run('multiple-done-beforeEach.fixture.js', args, function(err, result) {
res = result;
done(err);
});
Expand Down
6 changes: 3 additions & 3 deletions test/integration/only.js → test/integration/only.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var assert = require('assert');

describe('.only()', function() {
it('should run only tests that marked as `only`', function(done) {
run('options/only/bdd.js', ['--ui', 'bdd'], function(err, res) {
run('options/only/bdd.fixture.js', ['--ui', 'bdd'], function(err, res) {
assert(!err);
assert.equal(res.stats.pending, 0);
assert.equal(res.stats.passes, 11);
Expand All @@ -14,7 +14,7 @@ describe('.only()', function() {
});

it('should run only tests that marked as `only`', function(done) {
run('options/only/tdd.js', ['--ui', 'tdd'], function(err, res) {
run('options/only/tdd.fixture.js', ['--ui', 'tdd'], function(err, res) {
assert(!err);
assert.equal(res.stats.pending, 0);
assert.equal(res.stats.passes, 8);
Expand All @@ -25,7 +25,7 @@ describe('.only()', function() {
});

it('should run only tests that marked as `only`', function(done) {
run('options/only/qunit.js', ['--ui', 'qunit'], function(err, res) {
run('options/only/qunit.fixture.js', ['--ui', 'qunit'], function(err, res) {
assert(!err);
assert.equal(res.stats.pending, 0);
assert.equal(res.stats.passes, 5);
Expand Down

0 comments on commit 9e7f5f2

Please sign in to comment.