UNPKG

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