From: Wolfram Schneider Date: Tue, 3 Nov 2015 17:04:50 +0000 (+0000) Subject: move the jquery example test to test/spec-dev X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=bb7a8e61e67b1bfd4ae000b721fbe124e241755a;p=mkws-moved-to-github.git move the jquery example test to test/spec-dev This should fix the issue: MKWS is currently incompatible with nodejs 4.x, MKWS-415 The core issue is here is that the newer node.js is incompatible with many older modules, in part of jsdom which depends on contextify --- diff --git a/test/package.json b/test/package.json index 87414d7..e4f5b86 100644 --- a/test/package.json +++ b/test/package.json @@ -10,8 +10,6 @@ "email": "wosch@indexdata.com" }], "devDependencies": { - "jquery": "*", - "jsdom": "3.*", "xmlhttprequest": "*", "cssstyle": "*", "request": "*", diff --git a/test/spec-dev/jquery.spec.js b/test/spec-dev/jquery.spec.js new file mode 100644 index 0000000..2617b3d --- /dev/null +++ b/test/spec-dev/jquery.spec.js @@ -0,0 +1,32 @@ +/* Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com + * + * jquery test + * + */ + +describe("jquery suite simple", function () { + var $ = require('jquery')(require("jsdom").jsdom().parentWindow); + + it("jquery append test", function () { + $("body").append("

test passes h1

"); + expect($("body").html()).toMatch(/

/); + $("

this is a paragraph

").appendTo("h1"); + expect($("body").html()).toMatch(/this is a paragraph/); + }); + + it("$ append test", function () { + $("

test passes h2

").appendTo("body"); + expect($("body").html()).toMatch(/

/); + + $("

this is a second paragraph

").appendTo("h1"); + expect($("body").html()).toMatch(/this is a paragraph/); + }); + + it("more jquery tests", function () { + // other tests + expect($("h2").html()).toMatch(/test passes h2/); + expect($("h1").html()).toMatch(/test passes h1/); + expect($("h1").html()).not.toMatch(/^$/); + expect($("h1").html()).not.toMatch(/foobar/); + }); +}); diff --git a/test/spec/jquery.spec.js b/test/spec/jquery.spec.js deleted file mode 100644 index 2617b3d..0000000 --- a/test/spec/jquery.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com - * - * jquery test - * - */ - -describe("jquery suite simple", function () { - var $ = require('jquery')(require("jsdom").jsdom().parentWindow); - - it("jquery append test", function () { - $("body").append("

test passes h1

"); - expect($("body").html()).toMatch(/

/); - $("

this is a paragraph

").appendTo("h1"); - expect($("body").html()).toMatch(/this is a paragraph/); - }); - - it("$ append test", function () { - $("

test passes h2

").appendTo("body"); - expect($("body").html()).toMatch(/

/); - - $("

this is a second paragraph

").appendTo("h1"); - expect($("body").html()).toMatch(/this is a paragraph/); - }); - - it("more jquery tests", function () { - // other tests - expect($("h2").html()).toMatch(/test passes h2/); - expect($("h1").html()).toMatch(/test passes h1/); - expect($("h1").html()).not.toMatch(/^$/); - expect($("h1").html()).not.toMatch(/foobar/); - }); -});