test/render.test.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 23
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 3
c 1
b 0
f 0
nc 1
mnd 0
bc 3
fnc 3
dl 0
loc 23
rs 10
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A render.test.js ➔ ??? 0 18 1
1
'use strict'
2
const path = require('path')
3
const cons = require('consolidate')
4
const middleware = require('../')
5
6
test('should render the templates correctly', (done) => {
7
  const req = {}
8
  const res = {}
9
  const next = () => {}
10
11
  const opts = {
12
    engine: cons.pug,
13
    dir: path.join(__dirname, '../example')
14
  }
15
16
  middleware(opts)(req, res, next)
17
18
  res.render('view.pug', { name: 'nameless' }, (error, html) => {
19
    expect(error).toBeNull()
20
    expect(html).toEqual('<p style="color:red">nameless</p>')
21
    done()
22
  })
23
})
24