Skip to content

Commit 40caab4

Browse files
committed
Update config and tests to work on windows
1 parent 57eb9db commit 40caab4

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

karma.conf.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@ module.exports = function(config) {
1010

1111
// list of files / patterns to load in the browser
1212
files: [
13+
'node_modules/babel-polyfill/dist/polyfill.js',
1314
'bower_components/jquery/dist/jquery.min.js',
1415
'test/lib/angular.js',
1516
'test/lib/angular-mocks.js',
1617
'bower_components/tv4/tv4.js',
17-
'bower_components/objectpath/lib/ObjectPath.js',
18-
'src/module.js',
19-
'src/sfPath.js',
20-
'src/services/*.js',
21-
'src/directives/*.js',
22-
'bower_components/angular-schema-form-bootstrap/bootstrap-decorator.js',
18+
'dist/schema-form.js',
19+
'dist/bootstrap-decorator.js',
2320
'test/services/schema-form-test.js',
24-
'test/services/decorators-test.js',
25-
'test/services/messages-test.js',
26-
'test/directives/schema-form-test.js',
27-
'test/directives/sf-messages-test.js',
21+
// 'test/services/decorators-test.js',
22+
// 'test/services/messages-test.js',
23+
// 'test/directives/schema-form-test.js',
24+
// 'test/directives/sf-messages-test.js',
2825
],
2926

3027
// list of files to exclude
@@ -54,7 +51,9 @@ module.exports = function(config) {
5451
// possible values:
5552
// config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN ||
5653
// config.LOG_INFO || config.LOG_DEBUG
57-
logLevel: config.LOG_INFO,
54+
logLevel: config.LOG_ERROR,
55+
56+
loggers: [{type: 'console'}],
5857

5958
// enable / disable watching file and executing tests whenever any file changes
6059
autoWatch: true,
@@ -72,6 +71,9 @@ module.exports = function(config) {
7271
// If browser does not capture in given timeout [ms], kill it
7372
captureTimeout: 60000,
7473

74+
client: {
75+
captureConsole: true
76+
},
7577
// Continuous Integration mode
7678
// if true, it capture browsers, run tests and exit
7779
singleRun: false

package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"watch": "webpack --watch",
1212
"minify": "uglifyjs dist/schema-form.js --comments --output=dist/schema-form.min.js",
1313
"dist": "npm run build && npm run minify",
14-
"test": "rm -fr coverage && ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS karma.conf.js && find coverage/ -name lcov.info -print0 | xargs -0 cat | ./node_modules/coveralls/bin/coveralls.js"
14+
"testlinux": "rm -fr coverage && ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS karma.conf.js && find coverage/ -name lcov.info -print0 | xargs -0 cat | ./node_modules/coveralls/bin/coveralls.js",
15+
"test": "karma start --single-run --browsers PhantomJS karma.conf.js --log-level debug"
1516
},
16-
"author": "Textalk",
17+
"author": "json-schema-form",
1718
"contributors": [
1819
"David Jensen <david.lgj@gmail.com> (https://github.com/davidlgj)",
1920
"Marcel J Bennett <iamanthropic@gmail.com> (https://github.com/Anthropic)",
@@ -38,8 +39,9 @@
3839
"devDependencies": {
3940
"babel-core": "^6.5.2",
4041
"babel-loader": "^6.2.4",
42+
"babel-polyfill": "^6.9.1",
4143
"babel-preset-es2015": "^6.5.0",
42-
"chai": "^1.9.0",
44+
"chai": "^3.5.0",
4345
"coveralls": "^2.11.0",
4446
"gulp": "^3.5.6",
4547
"gulp-angular-templatecache": "^1.2.1",
@@ -51,17 +53,18 @@
5153
"gulp-uglify": "^0.2.1",
5254
"gulp-umd": "^0.1.3",
5355
"json-schema-form-core": "git+https://github.com/json-schema-form/json-schema-form-core.git#develop",
54-
"karma": "^0.12.0",
55-
"karma-chai-sinon": "^0.1.3",
56-
"karma-coverage": "^0.2.1",
56+
"karma": "^0.13.22",
57+
"karma-chai-sinon": "^0.1.5",
58+
"karma-coverage": "^1.0.0",
5759
"karma-growler-reporter": "0.0.1",
58-
"karma-mocha": "^0.1.3",
60+
"karma-mocha": "^1.0.1",
5961
"karma-phantomjs-launcher": "^0.1.4",
60-
"mocha": "^1.18.0",
62+
"karma-webpack": "^1.7.0",
63+
"mocha": "^2.5.3",
6164
"mocha-lcov-reporter": "0.0.1",
62-
"protractor": "^2.1.0",
63-
"sinon": "^1.9.0",
64-
"sinon-chai": "^2.5.0",
65+
"protractor": "^2.5.1",
66+
"sinon": "^1.17.4",
67+
"sinon-chai": "^2.8.0",
6568
"streamqueue": "0.0.5",
6669
"uglify-js": "^2.6.2",
6770
"webpack": "^1.12.14",

test/services/schema-form-test.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ chai.should();
22

33
describe('schemaForm', function() {
44
beforeEach(module('schemaForm'));
5-
65
describe('#defaults()', function() {
76
it('should generate default form def from a schema', function() {
87
inject(function(schemaForm) {
@@ -137,6 +136,9 @@ describe('schemaForm', function() {
137136
}
138137
},
139138
"ngModelOptions": {},
139+
"key": [
140+
"attributes"
141+
],
140142
"type": "fieldset",
141143
"items": [
142144
{
@@ -181,6 +183,10 @@ describe('schemaForm', function() {
181183
}
182184
},
183185
"ngModelOptions": {},
186+
"key": [
187+
"attributes",
188+
"shoulders"
189+
],
184190
"type": "fieldset",
185191
"items": [
186192
{
@@ -252,7 +258,7 @@ describe('schemaForm', function() {
252258
}
253259
];
254260

255-
var f = schemaForm.defaults(schema,{},{ formDefaults: { foo: "bar", ngModelOptions: { updateOn: 'blur' }}});
261+
var f = schemaForm.defaults(schema, schemaForm.typeDefault, {}, { formDefaults: { foo: "bar", ngModelOptions: { updateOn: 'blur' }}});
256262
f.form.should.be.deep.equal(form);
257263
});
258264
});
@@ -274,9 +280,7 @@ describe('schemaForm', function() {
274280
}
275281
};
276282

277-
278-
279-
var f = schemaForm.defaults(schema,{});
283+
var f = schemaForm.defaults(schema, schemaForm.typeDefault, {});
280284
f.form[0].type.should.be.eq('textarea');
281285
});
282286
});
@@ -314,16 +318,16 @@ describe('schemaForm', function() {
314318
describe('#appendRule() and #prependRule()', function() {
315319
it('should extend with new defaults',function(){
316320
module(function(schemaFormProvider){
317-
schemaFormProvider.prependRule('string',function(name,schema,options){
321+
schemaFormProvider.prependRule('string', function(name, schema, options){
318322
if (schema.format === 'foobar') {
319-
var f = schemaFormProvider.createStandardForm(name,schema,options);
323+
var f = schemaFormProvider.createStandardForm(name, schema, options);
320324
f.type = 'foobar';
321325
return f;
322326
}
323327
});
324328

325-
schemaFormProvider.appendRule('string',function(name,schema,options){
326-
var f = schemaFormProvider.createStandardForm(name,schema,options);
329+
schemaFormProvider.appendRule('string', function(name, schema, options){
330+
var f = schemaFormProvider.createStandardForm(name, schema, options);
327331
f.type = 'notused';
328332
return f;
329333
});
@@ -354,6 +358,9 @@ describe('schemaForm', function() {
354358

355359
//no form is implicitly ['*']
356360
var defaults = schemaForm.defaults(schema).form;
361+
console.log('defaults');
362+
console.log(JSON.stringify(defaults));
363+
//console.log(JSON.stringify(form));
357364
defaults[0].type.should.be.equal('foobar');
358365
defaults[0].title.should.be.equal('Name');
359366
defaults[1].type.should.be.equal('select');

0 commit comments

Comments
 (0)