helpers

Methods

(static) getHelper(ctx, name) → {function|null}

Source:
// CommonJS
const {getHelper} = require('hexo-test-utils')

// ES2015
import {getHelper} from 'hexo-test-utils'

Retrieves a helper function. Read the Hexo documentation on how to register a helper

Parameters:
Name Type Description
ctx HexoContext
name string

helper name

Returns:
  • a helper function
Type
function | null

(static) hasHelper(ctx, name) → {boolean}

Source:
// CommonJS
const {hasHelper} = require('hexo-test-utils')

// ES2015
import {hasHelper} from 'hexo-test-utils'
Parameters:
Name Type Description
ctx HexoContext
name string

helper name

Returns:
Type
boolean