1 |
|
2 |
|
3 | import 'babel-polyfill'
|
4 |
|
5 |
|
6 | import PythonTeX from '../../src/Rules/PythonTeX'
|
7 | import { initializeRule } from '../helpers'
|
8 |
|
9 | import type { RuleDefinition } from '../helpers'
|
10 |
|
11 | async function initialize ({
|
12 | RuleClass = PythonTeX,
|
13 | parameters = [{
|
14 | filePath: 'PythonTeX.pytxcode'
|
15 | }],
|
16 | ...rest }: RuleDefinition = {}) {
|
17 | return initializeRule({ RuleClass, parameters, ...rest })
|
18 | }
|
19 |
|
20 | describe('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 | })
|