I have an Express.js app that uses connect-asssets to serve JS and CSS:

app.configure(function() {
    app.set('port', 3000);
    app.set('views', path.join(__dirname, 'views'));
    app.set('view engine', 'ejs');
    app.use(connectAssets({src: path.join(__dirname, 'assets')}));
});

I'm trying to use Zombie.js for acceptance testing, but keep getting SyntaxError: Unexpected token ILLEGAL whenever it tries to parse a Javascript file. If I replace connect-assets with express.static, then the acceptance tests work perfectly.

Any idea what connect-assets does differently that would trip up Zombie.js?

有帮助吗?

解决方案

So I ran the requests through Charles. Zombie sends the request header Accept-Encoding: identity, but connect-assets returns GZIP data anyway.

I raised an issue with connect-file-cache on Github, hopefully everything will run fine once this is fixed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top