Remove unnecessary test
This commit is contained in:
6
Makefile
6
Makefile
@@ -86,7 +86,7 @@ check-deps:
|
||||
done ;\
|
||||
|
||||
.PHONY: ci
|
||||
ci: lint build test test-rendering test-node compile-examples check-examples apidoc
|
||||
ci: lint build test test-rendering compile-examples check-examples apidoc
|
||||
|
||||
.PHONY: compile-examples
|
||||
compile-examples: build/compiled-examples/all.combined.js
|
||||
@@ -135,10 +135,6 @@ serve: build/test_requires.js build/test_rendering_requires.js
|
||||
test: build/timestamps/node-modules-timestamp build/test_requires.js
|
||||
node tasks/test.js
|
||||
|
||||
.PHONY: test-node
|
||||
test-node: build/timestamps/node-modules-timestamp
|
||||
./node_modules/.bin/mocha test/node --fgrep 'has a path that maps to the provide'
|
||||
|
||||
.PHONY: test-coverage
|
||||
test-coverage: build/timestamps/node-modules-timestamp
|
||||
node tasks/test-coverage.js
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
"postinstall": "closure-util update",
|
||||
"start": "node tasks/serve.js",
|
||||
"pretest": "eslint tasks test test_rendering src examples",
|
||||
"test-node": "mocha test/node",
|
||||
"test": "node tasks/test.js",
|
||||
"debug-server": "node tasks/serve-lib.js"
|
||||
},
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
},
|
||||
"rules": {
|
||||
"strict": [2, "global"]
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const glob = require('glob');
|
||||
const path = require('path');
|
||||
|
||||
const src = path.join(__dirname, '..', '..', 'src');
|
||||
|
||||
const PROVIDE_RE = /^goog.provide\('(.*)'\);/;
|
||||
|
||||
describe('each file', () => {
|
||||
|
||||
const provides = {};
|
||||
|
||||
before(done => {
|
||||
glob('**/*.js', {cwd: src}, function(err, files) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
let count = files.length;
|
||||
let called = false;
|
||||
files.forEach(file => {
|
||||
fs.readFile(path.join(src, file), (err, data) => {
|
||||
if (!called && err) {
|
||||
called = true;
|
||||
return done(err);
|
||||
}
|
||||
provides[file] = [];
|
||||
String(data).split('\n').forEach(line => {
|
||||
const match = line.match(PROVIDE_RE);
|
||||
if (match) {
|
||||
provides[file].push(match[1]);
|
||||
}
|
||||
});
|
||||
--count;
|
||||
if (count === 0 && !called) {
|
||||
called = true;
|
||||
return done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('has a single provide', () => {
|
||||
for (let file in provides) {
|
||||
assert.equal(provides[file].length, 1, 'expected a single provide: ' + file);
|
||||
}
|
||||
});
|
||||
|
||||
it('has a path that maps to the provide', () => {
|
||||
for (let file in provides) {
|
||||
const provide = provides[file][0];
|
||||
if (!provide) {
|
||||
assert.equal(file, path.join('ol', 'typedefs.js'), 'only ol/typedefs.js can be missing a provide');
|
||||
continue;
|
||||
}
|
||||
let ext;
|
||||
if (file.endsWith('index.js')) {
|
||||
ext = path.sep + 'index.js';
|
||||
} else {
|
||||
ext = '.js';
|
||||
}
|
||||
const mapped = provide.split('.').map(part => part.toLowerCase()).join(path.sep) + ext;
|
||||
assert.equal(file, mapped, 'expected path to be like the provide: ' + file);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user