1 |
|
2 |
|
3 | import 'babel-polyfill'
|
4 |
|
5 | import Sage from '../../src/Rules/Sage'
|
6 | import { initializeRule } from '../helpers'
|
7 |
|
8 | import type { RuleDefinition } from '../helpers'
|
9 |
|
10 | async function initialize ({
|
11 | RuleClass = Sage,
|
12 | parameters = [{
|
13 | filePath: 'Sage.sage'
|
14 | }],
|
15 | ...rest }: RuleDefinition = {}) {
|
16 | return initializeRule({ RuleClass, parameters, ...rest })
|
17 | }
|
18 |
|
19 | describe('Sage', () => {
|
20 | describe('constructCommand', () => {
|
21 | it('returns correct arguments and command options for sage file.', async (done) => {
|
22 | const { rule } = await initialize()
|
23 |
|
24 | expect(rule.constructCommand()).toEqual({
|
25 | args: ['sage', '{{$BASE_0}}'],
|
26 | cd: '$ROOTDIR_0',
|
27 | severity: 'error',
|
28 | outputs: [
|
29 | '$DIR_0/$NAME_0.sout',
|
30 | '$DIR_0/$NAME_0.sage.cmd',
|
31 | '$DIR_0/$NAME_0.scmd',
|
32 | '$FILEPATH_0.py'
|
33 | ],
|
34 | globbedOutputs: ['$DIR_0/sage-plots-for-$JOB.tex/*']
|
35 | })
|
36 |
|
37 | done()
|
38 | })
|
39 | })
|
40 | })
|