UNPKG

975 BJavaScriptView Raw
1/* @flow */
2
3import 'babel-polyfill'
4
5import MakeGlossaries from '../../src/Rules/MakeGlossaries'
6import { initializeRule } from '../helpers'
7
8import type { RuleDefinition } from '../helpers'
9
10async function initialize ({
11 RuleClass = MakeGlossaries,
12 parameters = [{
13 filePath: 'GlossaryControlFile.glo'
14 }],
15 ...rest }: RuleDefinition = {}) {
16 return initializeRule({ RuleClass, parameters, ...rest })
17}
18
19describe('MakeGlossaries', () => {
20 describe('constructCommand', () => {
21 it('returns correct arguments and command options for glossary file.', async (done) => {
22 const { rule } = await initialize()
23
24 expect(rule.constructCommand()).toEqual({
25 args: ['makeglossaries', 'GlossaryControlFile'],
26 cd: '$ROOTDIR',
27 severity: 'error',
28 outputs: [
29 '$DIR_0/$NAME_0.acr',
30 '$DIR_0/$NAME_0.alg',
31 '$DIR_0/$NAME_0.gls',
32 '$DIR_0/$NAME_0.glg'
33 ]
34 })
35
36 done()
37 })
38 })
39})