Skip to content

Commit

Permalink
Fix relative paths and some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saharj committed May 17, 2016
1 parent 78fd501 commit 67773bd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
3 changes: 0 additions & 3 deletions scripts/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* This file helps loading components easier in tests
*/

// Configurations
require('scripts/config/app.config.js');

// Router
require('scripts/router');

Expand Down
8 changes: 0 additions & 8 deletions scripts/config/app.config.js

This file was deleted.

40 changes: 20 additions & 20 deletions test/unit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ window.SwaggerEditor = angular.module('SwaggerEditor', [
]);

// Require app components
require('../../scripts/components');
require('scripts/components.js');

// Test config
require('./defaults.js');
require('defaults.js');

// Load tests
require('./spec/controllers/editor');
require('./spec/controllers/errorpresenter');
require('./spec/controllers/file-import');
require('./spec/controllers/main');
require('./spec/controllers/openexamples');
require('./spec/controllers/preview');
require('./spec/controllers/tryoperation');
require('./spec/controllers/url-import');
require('spec/controllers/editor');
require('spec/controllers/errorpresenter');
require('spec/controllers/file-import');
require('spec/controllers/main');
require('spec/controllers/openexamples');
require('spec/controllers/preview');
require('spec/controllers/tryoperation');
require('spec/controllers/url-import');

require('./spec/directives/collapsewhen');
require('./spec/directives/schemamodel');
require('spec/directives/collapsewhen');
require('spec/directives/schemamodel');

require('./spec/services/ast-manager');
require('./spec/services/autocomplete');
require('./spec/services/backend');
require('./spec/services/builder');
require('./spec/services/editor');
require('./spec/services/fileloader');
require('./spec/services/fold-state-manager');
require('./spec/services/storage');
require('spec/services/ast-manager');
require('spec/services/autocomplete');
require('spec/services/backend');
require('spec/services/builder');
require('spec/services/editor');
require('spec/services/fileloader');
require('spec/services/fold-state-manager');
require('spec/services/storage');
8 changes: 8 additions & 0 deletions test/unit/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

var path = require("path");

var webpackConfig = require('../../webpack.config.js');

module.exports = function(config) {
Expand Down Expand Up @@ -35,6 +37,12 @@ module.exports = function(config) {
webpack: {
module: {
loaders: webpackConfig.module.loaders
},
resolve: {
root: [
__dirname,
path.join(__dirname, '../../')
]
}
},

Expand Down
9 changes: 6 additions & 3 deletions test/unit/spec/directives/schemamodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ describe('Directive: schemaModel', function() {
scope = $rootScope.$new();
}));

it('should make hidden element visible', inject(function($compile) {
element = angular.element('<schema-model></schema-model>');
it('should render', inject(function($compile) {
scope.stringSchema = {type: 'string'};
element = angular.element(
'<schema-model schema="stringSchema"></schema-model>'
);
element = $compile(element)(scope);
expect(element.text()).to.equal('');
expect(element.text()).to.contain('⇄');
}));
});

0 comments on commit 67773bd

Please sign in to comment.