routing

Methods

(static) contentFor(ctx, path) → {Promise.<Buffer>}

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

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

Loads the content of the file on a given path

Parameters:
Name Type Description
ctx HexoContext
path string

a path to the file, relative to the root URL, for example /content/my_image.jpg

Returns:
Type
Promise.<Buffer>

(static) hasRoute(ctx, path) → {boolean}

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

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

Checks if a given path is registered in routing, so it would be generated

Parameters:
Name Type Description
ctx HexoContext
path string | RegExp

a path to the file, relative to the root URL, for example /content/my_image.jpg

Returns:
Type
boolean