From 2b2ab123a5e0b81d9d3967808f097a80440f1664 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sun, 12 Sep 2010 09:03:43 +0000 Subject: additional test for non-circular commonjs require. closes COUCHDB-869 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@996270 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