From 594a3bf18969d6cbab5671abf5c5945d6df2aab9 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 21 Aug 2013 18:09:12 +0200 Subject: [PATCH] don't mix jQuery and '$', they can be different variables --- test/spec/jquery.spec.js | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/test/spec/jquery.spec.js b/test/spec/jquery.spec.js index 107094d..e5c34e2 100644 --- a/test/spec/jquery.spec.js +++ b/test/spec/jquery.spec.js @@ -4,31 +4,29 @@ * */ -var $ = jQuery = require('jquery'); +describe("jQuery suite simple", function() { + var $ = require('jquery'); -describe("jQuery suite", function() { - it("jQuery append test", function() { - jQuery("

test passes h1

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

/); + 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/); + }); - jQuery("

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(/

/); - 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/); + }); - $("

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/); - }); + 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