Skip to content

Commit

Permalink
Move installation and config of sinon from bower+requirejs to karma-s…
Browse files Browse the repository at this point in the history
…inon. Sinon is a testing tool and don't belong in our main module requirements. Keep all dev-dependencies in package.json
  • Loading branch information
sunew committed Sep 19, 2018
1 parent 7c9dffc commit 22099dc
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 48 deletions.
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
"cs-jqtree-contextmenu": "^0.1.0"
},
"devDependencies": {
"expect": "0.3.1",
"sinonjs": "1.17.1"
"expect": "0.3.1"
},
"resolutions": {
"bootstrap": "3.3.6",
Expand Down
3 changes: 2 additions & 1 deletion mockup/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"require": false,
"requirejs": true,
"tinymce": true,
"window": false
"window": false,
"sinon": true
}
}
2 changes: 0 additions & 2 deletions mockup/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
'picker.time': 'bower_components/pickadate/lib/picker.time',
'react': 'bower_components/react/react',
'select2': 'bower_components/select2/select2',
'sinon': 'bower_components/sinonjs/sinon',
'text': 'bower_components/requirejs-text/text',
'tinymce': 'bower_components/tinymce-builded/js/tinymce/tinymce',
'tinymce-modern-theme': 'bower_components/tinymce-builded/js/tinymce/themes/modern/theme',
Expand Down Expand Up @@ -168,7 +167,6 @@
'jquery.event.drop': { deps: ['jquery'], exports: '$.drop' },
'picker.date': { deps: [ 'picker' ] },
'picker.time': { deps: [ 'picker' ] },
'sinon': { exports: 'window.sinon' },
'tinymce': {
exports: 'window.tinyMCE',
init: function () {
Expand Down
6 changes: 5 additions & 1 deletion mockup/js/grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
karma: {
options: {
basePath: './',
frameworks: ['mocha', 'chai'],
frameworks: ['mocha', 'chai', 'sinon'],
files: this.files.concat([
{pattern: 'bower_components/tinymce-builded/js/tinymce/skins/lightgray/content.min.css', watched: false, included: true, served: true, nocache: true}
]),
Expand All @@ -338,6 +338,7 @@
plugins: [
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-coverage',
'karma-requirejs',
'karma-sauce-launcher',
Expand Down Expand Up @@ -371,6 +372,7 @@
plugins: [
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-requirejs',
'karma-chrome-launcher'
]
Expand All @@ -382,6 +384,7 @@
plugins: [
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-requirejs',
'karma-firefox-launcher'
]
Expand All @@ -392,6 +395,7 @@
plugins: [
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-requirejs'
]
},
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/fakeserver.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
define([
'sinon',
'jquery',
'underscore'
], function(sinon, $, _) {
], function($, _) {
'use strict';

function getQueryVariable(url, variable) {
Expand Down
5 changes: 2 additions & 3 deletions mockup/tests/i18n-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
define([
'expect',
'jquery',
'mockup-i18n',
'sinon'
], function(expect, $, I18n, sinon) {
'mockup-i18n'
], function(expect, $, I18n) {
'use strict';

window.mocha.setup('bdd');
Expand Down
5 changes: 2 additions & 3 deletions mockup/tests/pattern-contentloader-test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-contentloader'
], function(expect, $, sinon, registry, ContentLoader) {
], function(expect, $, registry, ContentLoader) {
'use strict';

window.mocha.setup('bdd');
$.fx.off = true;

/* ==========================
TEST: Livesearch
TEST: Livesearch
========================== */

describe('Livesearch', function() {
Expand Down
9 changes: 4 additions & 5 deletions mockup/tests/pattern-cookietrigger-test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-cookietrigger'
], function(expect, $, sinon, registry, Pattern) {
], function(expect, $, registry, Pattern) {
'use strict';

window.mocha.setup('bdd');
$.fx.off = true;

/* ====================
TEST: Cookie Trigger
TEST: Cookie Trigger
==================== */

describe('Cookie Trigger', function () {
Expand All @@ -20,7 +19,7 @@ define([
});

it('The .pat-cookietrigger DOM element is shown if cookies are disabled', function() {
var widget =
var widget =
'<div class="portalMessage error pat-cookietrigger">' +
' Cookies are not enabled. You must enable cookies before you can log in.' +
'</div>';
Expand All @@ -33,7 +32,7 @@ define([
});

it('The .pat-cookietrigger DOM element is hidden if cookies are enabled', function() {
var widget =
var widget =
'<div class="portalMessage error pat-cookietrigger">' +
' Cookies are not enabled. You must enable cookies before you can log in.' +
'</div>';
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-filemanager-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'sinon',
'expect',
'jquery',
'pat-registry',
'mockup-patterns-filemanager'
], function(sinon, expect, $, registry, Tree) {
], function(expect, $, registry, Tree) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-inlinevalidation-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-inlinevalidation'
], function(expect, $, sinon, registry, Pattern) {
], function(expect, $, registry, Pattern) {
'use strict';

window.mocha.setup('bdd');
Expand Down
5 changes: 2 additions & 3 deletions mockup/tests/pattern-livesearch-test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-livesearch'
], function(expect, $, sinon, registry, Livesearch) {
], function(expect, $, registry, Livesearch) {
'use strict';

window.mocha.setup('bdd');
$.fx.off = true;

/* ==========================
TEST: Livesearch
TEST: Livesearch
========================== */

describe('Livesearch', function() {
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-modal-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-modal'
], function(expect, $, sinon, registry, Modal) {
], function(expect, $, registry, Modal) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-pickadate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-pickadate',
'mockup-patterns-select2'
], function(expect, $, sinon, registry, PickADate) {
], function(expect, $, registry, PickADate) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-relateditems-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ define([
'expect',
'jquery',
'underscore',
'sinon',
'pat-registry',
'mockup-patterns-relateditems'
], function(expect, $, _, sinon, registry, RelatedItems) {
], function(expect, $, _, registry, RelatedItems) {
'use strict';

window.mocha.setup('bdd').globals(['jQuery*']);
Expand Down
5 changes: 2 additions & 3 deletions mockup/tests/pattern-resourceregistry-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'sinon',
'expect',
'jquery',
'pat-registry',
'mockup-patterns-resourceregistry'
], function(sinon, expect, $, registry, ResourceRegistry) {
], function(expect, $, registry, ResourceRegistry) {
'use strict';

window.mocha.setup('bdd');
Expand Down Expand Up @@ -140,4 +139,4 @@ define([

});

});
});
3 changes: 1 addition & 2 deletions mockup/tests/pattern-select2-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'mockup-patterns-select2'
], function(expect, $, sinon, registry, Select2) {
], function(expect, $, registry, Select2) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-structure-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ define([
'mockup-patterns-structure-url/js/views/generic-popover',
'mockup-patterns-structure-url/js/collections/result',
'mockup-utils',
'sinon',
'moment'
], function(expect, $, _, registry, ButtonView, Structure, ActionMenuView, AppView, Result,
TableView, TableRowView, PropertiesView, ResultCollection, utils, sinon, moment) {
TableView, TableRowView, PropertiesView, ResultCollection, utils, moment) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-thememapper-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define([
'expect',
'sinon',
'jquery',
'pat-registry',
'mockup-patterns-thememapper',
], function(expect, sinon, $, registry, RuleBuilderView ) {
], function(expect, $, registry, RuleBuilderView ) {
'use strict';

window.mocha.setup('bdd');
Expand Down
3 changes: 1 addition & 2 deletions mockup/tests/pattern-tinymce-test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
define([
'expect',
'jquery',
'sinon',
'pat-registry',
'tinymce',
'mockup-patterns-tinymce'
], function(expect, $, sinon, registry, tinymce, TinyMCE) {
], function(expect, $, registry, tinymce, TinyMCE) {
'use strict';

window.mocha.setup('bdd');
Expand Down
5 changes: 2 additions & 3 deletions mockup/tests/pattern-toggle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ define([
'jquery',
'pat-registry',
'pat-logger',
'mockup-patterns-toggle',
'sinon',
], function(expect, $, registry, logger, Toggle, sinon) {
'mockup-patterns-toggle'
], function(expect, $, registry, logger, Toggle) {
'use strict';

window.mocha.setup('bdd');
Expand Down
2 changes: 1 addition & 1 deletion mockup/tests/utils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ define([
expect(utils.bool(13)).to.be.equal(true);
expect(utils.bool('foo')).to.be.equal(true);
});

it('returns false for falsy values', function() {
expect(utils.bool('false')).to.be.equal(false);
expect(utils.bool(' false ')).to.be.equal(false);
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
"karma-sauce-launcher": "~1.0.0",
"karma-script-launcher": "~1.0.0",
"karma-spec-reporter": "0.0.26",
"karma-sinon": "^1.0.5",
"lcov-result-merger": "~1.2.0",
"less": "~1.7.0",
"mocha": "~2.5.3",
"phantomjs-prebuilt": "^2.1.7",
"requirejs": "~2.2.0"
"requirejs": "~2.2.0",
"sinon": "1.17.1"
},
"maintainers": [
{
Expand Down

0 comments on commit 22099dc

Please sign in to comment.