removed files
attempting commit with fewer files; these are the ones removed
This commit is contained in:
@@ -1,87 +0,0 @@
|
||||
(function(global) {
|
||||
var karma = global.__karma__;
|
||||
var requirejs = global.requirejs
|
||||
var locationPathname = global.location.pathname;
|
||||
var root = 'src';
|
||||
karma.config.args.forEach(function(value, index) {
|
||||
if (value === 'aurelia-root') {
|
||||
root = karma.config.args[index + 1];
|
||||
}
|
||||
});
|
||||
|
||||
if (!karma || !requirejs) {
|
||||
return;
|
||||
}
|
||||
|
||||
function normalizePath(path) {
|
||||
var normalized = []
|
||||
var parts = path
|
||||
.split('?')[0] // cut off GET params, used by noext requirejs plugin
|
||||
.split('/')
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
if (parts[i] === '.') {
|
||||
continue
|
||||
}
|
||||
|
||||
if (parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..') {
|
||||
normalized.pop()
|
||||
continue
|
||||
}
|
||||
|
||||
normalized.push(parts[i])
|
||||
}
|
||||
|
||||
// Use case of testing source code. RequireJS doesn't add .js extension to files asked via sibling selector
|
||||
// If normalized path doesn't include some type of extension, add the .js to it
|
||||
if (normalized.length > 0 && normalized[normalized.length - 1].indexOf('.') < 0) {
|
||||
normalized[normalized.length - 1] = normalized[normalized.length - 1] + '.js'
|
||||
}
|
||||
|
||||
return normalized.join('/')
|
||||
}
|
||||
|
||||
function patchRequireJS(files, originalLoadFn, locationPathname) {
|
||||
var IS_DEBUG = /debug\.html$/.test(locationPathname)
|
||||
|
||||
requirejs.load = function (context, moduleName, url) {
|
||||
url = normalizePath(url)
|
||||
|
||||
if (files.hasOwnProperty(url) && !IS_DEBUG) {
|
||||
url = url + '?' + files[url]
|
||||
}
|
||||
|
||||
if (url.indexOf('/base') !== 0) {
|
||||
url = '/base/' + url;
|
||||
}
|
||||
|
||||
return originalLoadFn.call(this, context, moduleName, url)
|
||||
}
|
||||
|
||||
var originalDefine = global.define;
|
||||
global.define = function(name, deps, m) {
|
||||
if (typeof name === 'string') {
|
||||
originalDefine('/base/' + root + '/' + name, [name], function (result) { return result; });
|
||||
}
|
||||
|
||||
return originalDefine(name, deps, m);
|
||||
}
|
||||
}
|
||||
|
||||
function requireTests() {
|
||||
var TEST_REGEXP = /(spec)\.js$/i;
|
||||
var allTestFiles = ['/base/test/unit/setup.js'];
|
||||
|
||||
Object.keys(window.__karma__.files).forEach(function(file) {
|
||||
if (TEST_REGEXP.test(file)) {
|
||||
allTestFiles.push(file);
|
||||
}
|
||||
});
|
||||
|
||||
require(allTestFiles, window.__karma__.start);
|
||||
}
|
||||
|
||||
karma.loaded = function() {}; // make it async
|
||||
patchRequireJS(karma.files, requirejs.load, locationPathname);
|
||||
requireTests();
|
||||
})(window);
|
||||
@@ -1,7 +0,0 @@
|
||||
import {App} from '../../src/app';
|
||||
|
||||
describe('the app', () => {
|
||||
it('says hello', () => {
|
||||
expect(new App().message).toBe('Hello World!');
|
||||
});
|
||||
});
|
||||
@@ -1,3 +0,0 @@
|
||||
import 'aurelia-polyfills';
|
||||
import {initialize} from 'aurelia-pal-browser';
|
||||
initialize();
|
||||
Reference in New Issue
Block a user