Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update test/express-expose.test.js #24

Merged
merged 1 commit into from

2 participants

@pgherveou

add one test to check javascript is exposed in views 

@pgherveou pgherveou Update test/express-expose.test.js
add one test to check javascript is exposed in views 
b3c04a3
@pgherveou

following our discussion in issues #23
Not sure the test is correct, but it is failing at the moment

@tj
Owner
tj commented

ahh yeah I didn't try with app.render, right now it's using middleware so that definitely wont expose them

@tj tj merged commit 3c27258 into expressjs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 7, 2012
  1. @pgherveou

    Update test/express-expose.test.js

    pgherveou authored
    add one test to check javascript is exposed in views 
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 1 deletion.
  1. +14 −1 test/express-expose.test.js
View
15 test/express-expose.test.js
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -132,5 +131,19 @@ module.exports = {
vm.runInNewContext(js, scope);
scope.sub(8,7).should.equal(1);
scope.should.not.have.property('add');
+ },
+
+ 'test render view' : function (done) {
+ var app = express();
+
+ app.expose('var foo;');
+ app.set('view engine', 'jade');
+ app.set('views', __dirname + '/views');
+
+ app.render('index', function(err, str){
+ if (err) return done(err);
+ str.should.match(/var foo;/);
+ done();
+ });
}
};
Something went wrong with that request. Please try again.