From bb7a8e61e67b1bfd4ae000b721fbe124e241755a Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Tue, 3 Nov 2015 17:04:50 +0000 Subject: [PATCH] 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 --- test/package.json | 2 -- test/spec-dev/jquery.spec.js | 32 ++++++++++++++++++++++++++++++++ test/spec/jquery.spec.js | 32 -------------------------------- 3 files changed, 32 insertions(+), 34 deletions(-) create mode 100644 test/spec-dev/jquery.spec.js delete mode 100644 test/spec/jquery.spec.js 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/); - }); -}); -- 1.7.10.4