File size: 1,154 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 * @jest-environment jsdom
 */

import { getImporterEngines, getImportersAsImporterOption } from '../importer-config';

describe( 'importer-config', () => {
	test( 'It retrieves the importer engines', () => {
		const importerEngines = getImporterEngines();

		expect( Array.isArray( importerEngines ) ).toBeTruthy();
		expect( importerEngines.every( ( item ) => typeof item === 'string' ) ).toBeTruthy();
	} );

	test( 'It retrieves the importer primary configs as ImporterOptions', () => {
		const importerOptions = getImportersAsImporterOption( 'primary' );

		expect( Array.isArray( importerOptions ) ).toBeTruthy();
		expect( importerOptions.length ).toBeGreaterThan( 0 );
		expect( importerOptions.every( ( item ) => item?.priority === 'primary' ) ).toBeTruthy();
	} );

	test( 'It retrieves the importer secondary configs as ImporterOptions', () => {
		const importerOptions = getImportersAsImporterOption( 'secondary' );

		expect( Array.isArray( importerOptions ) ).toBeTruthy();
		expect( importerOptions.length ).toBeGreaterThan( 0 );
		expect( importerOptions.every( ( item ) => item?.priority === 'secondary' ) ).toBeTruthy();
	} );
} );