wadl-client
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "wadl-client", | ||
"main": "wadl-client.js", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/rbelouin/wadl-client", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -10,8 +10,27 @@ module.exports = function(grunt) { | ||
}, | ||
browserify: { | ||
test: { | ||
files: { | ||
"spec/bundle.js": "spec/wadl-client.spec.js" | ||
}, | ||
options: { | ||
ignore: ["request", "xml2json"] | ||
} | ||
} | ||
}, | ||
jasmine: { | ||
src: ["spec/browser-dependencies.js", "spec/resources.js", "wadl-client.js"], | ||
options: { | ||
host: "http://localhost:3000/", | ||
outfile: "index.html", | ||
specs: "spec/wadl-client.spec.js" | ||
browserify: { | ||
options: { | ||
host: "http://localhost:3000/", | ||
outfile: "index.html", | ||
specs: "spec/bundle.js" | ||
} | ||
}, | ||
default: { | ||
src: ["spec/browser-dependencies.js", "spec/resources.js", "wadl-client.js"], | ||
options: { | ||
host: "http://localhost:3000/", | ||
outfile: "index.html", | ||
specs: "spec/wadl-client.spec.js" | ||
} | ||
} | ||
@@ -23,3 +42,3 @@ }, | ||
jshint: { | ||
all: ["wadl-client.js", "spec/**/*.js"] | ||
all: ["wadl-client.js", "spec/**/*.spec.js"] | ||
} | ||
@@ -29,2 +48,3 @@ }); | ||
grunt.loadNpmTasks('grunt-bower-concat'); | ||
grunt.loadNpmTasks('grunt-browserify'); | ||
grunt.loadNpmTasks('grunt-contrib-jasmine'); | ||
@@ -43,5 +63,5 @@ grunt.loadNpmTasks('grunt-jasmine-node'); | ||
grunt.registerTask("test-node", "jasmine_node"); | ||
grunt.registerTask("test-browser", ["bower_concat", "jasmine"]); | ||
grunt.registerTask("test-browser", ["bower_concat", "browserify", "jasmine"]); | ||
grunt.registerTask("test", ["test-node", "test-browser"]); | ||
grunt.registerTask("default", ["jshint", "start-test-server", "test", "stop-test-server"]); | ||
}; |
{ | ||
"name": "wadl-client", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Generate a Javascript client for a web API providing a WADL description", | ||
@@ -19,9 +19,10 @@ "main": "wadl-client.js", | ||
"devDependencies": { | ||
"body": "^4.4.2", | ||
"express": "^4.0.0", | ||
"grunt": "^0.4.4", | ||
"grunt-jasmine-node": "^0.2.1", | ||
"express": "^4.0.0", | ||
"body": "^4.4.2", | ||
"grunt-bower-concat": "^0.2.4", | ||
"grunt-browserify": "^2.1.3", | ||
"grunt-contrib-jasmine": "^0.6.3", | ||
"grunt-bower-concat": "^0.2.4", | ||
"grunt-contrib-jshint": "^0.10.0" | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-jasmine-node": "^0.2.1" | ||
}, | ||
@@ -28,0 +29,0 @@ "scripts": { |
var resources = resources || require("./resources.js"); | ||
var WadlClient = WadlClient || require("../wadl-client.js"); | ||
var isServerSide = typeof module != "undefined" && module.exports && typeof require == "function"; | ||
var client = WadlClient.buildClient(resources, { | ||
@@ -178,7 +176,3 @@ host: "http://localhost:3000" | ||
p.map(function(result) { | ||
if(isServerSide) { | ||
expect(result.a).not.toBeUndefined(); | ||
expect(result.a[0]).toBe(1); | ||
} | ||
else { | ||
if(result.getElementsByTagName) { | ||
var a = result.getElementsByTagName("a"); | ||
@@ -188,2 +182,6 @@ expect(a && a[0]).not.toBeUndefined(); | ||
} | ||
else { | ||
expect(result.a).not.toBeUndefined(); | ||
expect(result.a[0]).toBe(1); | ||
} | ||
done(); | ||
@@ -190,0 +188,0 @@ }); |
var WadlClient = (function() { | ||
/* Dependency aliases (to make WadlClient work on both node and browser environments) */ | ||
var P = typeof Promise != "undefined" ? Promise : require("pacta"); | ||
var request = typeof module != "undefined" && module.exports && typeof require == "function" ? require("request") : null; | ||
var parser = typeof module != "undefined" && module.exports && typeof require == "function" ? require("xml2json") : null; | ||
var P = typeof require == "function" && require("pacta") ? require("pacta") : Promise; | ||
var request = typeof XMLHttpRequest != "undefined" ? null : require("request"); | ||
var parser = typeof XMLHttpRequest != "undefined" ? null : require("xml2json"); | ||
@@ -7,0 +7,0 @@ var WadlClient = {}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20387
583
8