ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /lib/node_modules/forever/node_modules/flatiron/test/plugins/ |
/* * static-test.js: Tests for flatiron app(s) using the static plugin * * (C) 2011, Nodejitsu Inc. * MIT LICENSE * */ var assert = require('assert'), fs = require('fs'), path = require('path'), request = require('request'), vows = require('vows'); var appDir = path.join(__dirname, '..', '..', 'examples', 'static-app'), app = require(path.join(appDir, 'app')); vows.describe('flatiron/plugins/static').addBatch({ "A flatiron app using `flatiron.plugins.static": { topic: app, "should extend the app correctly": function (app) { assert.isString(app._staticDir); assert.isFunction(app.static); assert.isFunction(app.http.before[0]); }, "when the application is running": { topic: function () { app.start(8080, this.callback) }, "a GET to /headers": { topic: function () { request('http://localhost:8080/headers', this.callback); }, "should respond with JSON headers": function (err, res, body) { assert.isNull(err); assert.equal(res.statusCode, 200); assert.isObject(JSON.parse(body)); } }, "a GET to /style.css": { topic: function () { request('http://localhost:8080/style.css', this.callback); }, "should respond with style.css file": function (err, res, body) { assert.isNull(err); assert.equal(res.statusCode, 200); assert.equal( fs.readFileSync(path.join(appDir, 'app', 'assets', 'style.css'), 'utf8'), body ); } } } } }).export(module);