From c118442adb9f43dcd9bd70f4113cf91aaaa00ff1 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sun, 12 Sep 2010 09:01:47 +0000 Subject: additional test for non-circular commonjs require. closes COUCHDB-869 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@996267 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/design_docs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/www/script/test/design_docs.js b/share/www/script/test/design_docs.js index 2e3e1db1..8864225c 100644 --- a/share/www/script/test/design_docs.js +++ b/share/www/script/test/design_docs.js @@ -58,7 +58,8 @@ function() { }, shows: { simple: "function() {return 'ok'};", - requirey : "function() { var lib = require('whatever/commonjs/upper'); return lib.testing; };" + requirey : "function() { var lib = require('whatever/commonjs/upper'); return lib.testing; };", + circular : "function() { var lib = require('whatever/commonjs/upper'); return JSON.stringify(this); };" } }; @@ -88,6 +89,10 @@ function() { T(xhr.status == 200); TEquals("PLANKTONwhatever/commonjs/upperplankton", xhr.responseText); + var xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/circular"); + T(xhr.status == 200); + TEquals("javascript", JSON.parse(xhr.responseText).language); + // test that we get design doc info back var dinfo = db.designInfo("_design/test"); TEquals("test", dinfo.name); -- cgit v1.2.3