From: Aleksander Ɓukasz Date: Tue, 18 Jun 2013 14:28:13 +0000 (+0200) Subject: testing wip: using requirejs X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/540ab2ebda6121a52a15f82e531ef8ba558024b1 testing wip: using requirejs --- diff --git a/karma.conf.js b/karma.conf.js index 78ad3b8..b6085cc 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,15 +3,18 @@ basePath = ''; files = [ MOCHA, MOCHA_ADAPTER, - /*REQUIRE, - REQUIRE_ADAPTER*/ - - 'libs/chai.js', - 'libs/jquery-1.9.1.min.js', - - 'tests/conf.js', - 'modules/documentCanvas/tests/tests_transform.js' + REQUIRE, + REQUIRE_ADAPTER, + {pattern: 'libs/*.js', included: false}, + {pattern: 'fnpjs/**/*.js', included: false}, + {pattern: 'modules/**/*.js', included: false}, + {pattern: 'views/**/*.js', included: false}, + {pattern: 'fnpjs/**/*.html', included: false}, + {pattern: 'modules/**/*.html', included: false}, + {pattern: 'views/**/*.html', included: false}, + + 'tests/main.js', ]; reporters = ['progress']; diff --git a/modules/documentCanvas/tests/tests_transform.js b/modules/documentCanvas/tests/tests_transform.js deleted file mode 100644 index b693e12..0000000 --- a/modules/documentCanvas/tests/tests_transform.js +++ /dev/null @@ -1,7 +0,0 @@ -suite('Transform', function() { - - test('test1', function() { - assert.ok(true); - }); - -}); \ No newline at end of file diff --git a/modules/documentCanvas/tests/transform.test.js b/modules/documentCanvas/tests/transform.test.js new file mode 100644 index 0000000..66140e5 --- /dev/null +++ b/modules/documentCanvas/tests/transform.test.js @@ -0,0 +1,13 @@ +define(['libs/chai', 'modules/documentCanvas/transformations'], function(chai, transformations) { + + var assert = chai.assert; + + suite('Transform', function() { + + test('test1', function() { + assert.ok(true); + }); + + }); + +}); \ No newline at end of file diff --git a/tests/conf.js b/tests/conf.js deleted file mode 100644 index 431acb7..0000000 --- a/tests/conf.js +++ /dev/null @@ -1,3 +0,0 @@ -mocha.setup('tdd'); - -var assert = chai.assert; \ No newline at end of file diff --git a/tests/main.js b/tests/main.js new file mode 100644 index 0000000..8a093d9 --- /dev/null +++ b/tests/main.js @@ -0,0 +1,15 @@ +(function() { + + mocha.setup('tdd'); + + var tests = Object.keys(window.__karma__.files).filter(function (file) { + return /\.test\.js$/.test(file); + }); + + require({ + baseUrl: '/base/', + deps: tests, + callback: window.__karma__.start + }); + +})(); \ No newline at end of file