mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Port the unit tests from https://github.com/vercel/nft/tree/941be1cb3b9d38fbc99a8a6f07af568a64ed0f12/test/unit
22 lines
471 B
JavaScript
22 lines
471 B
JavaScript
const assert = require('assert')
|
|
var express = require('express'),
|
|
cons = require('consolidate'),
|
|
app = express()
|
|
|
|
// assign the swig engine to .html files
|
|
app.engine('html', cons.swig)
|
|
|
|
// set .html as the default extension
|
|
app.set('view engine', 'html')
|
|
app.set('views', __dirname + '/fixtures' + '/html')
|
|
|
|
app.render(
|
|
'index',
|
|
{
|
|
title: 'Consolidate.js',
|
|
},
|
|
function (err, rendered) {
|
|
assert.ok(rendered.startsWith('<h1>Consolidate.js</h1>'))
|
|
}
|
|
)
|