11import * as assert from 'assert' ;
22import * as srcConfiguration from '../../src/configuration/configuration' ;
3- import * as testConfiguration from '../testConfiguration' ;
43import * as vscode from 'vscode' ;
54import { cleanUpWorkspace , setupWorkspace } from './../testUtils' ;
65import { Mode } from '../../src/mode/mode' ;
76import { newTest } from '../testSimplifier' ;
7+ import { IConfiguration } from '../../src/configuration/iconfiguration' ;
88
9- suite ( 'Configuration' , ( ) => {
10- const configuration = new testConfiguration . Configuration ( ) ;
11- configuration . leader = '<space>' ;
12- configuration . normalModeKeyBindingsNonRecursive = [
9+ const testConfig : Partial < IConfiguration > = {
10+ leader : '<space>' ,
11+ normalModeKeyBindingsNonRecursive : [
1312 {
1413 before : [ 'leader' , 'o' ] ,
1514 after : [ 'o' , 'eSc' , 'k' ] ,
@@ -18,21 +17,23 @@ suite('Configuration', () => {
1817 before : [ '<leader>' , 'f' , 'e' , 's' ] ,
1918 after : [ 'v' ] ,
2019 } ,
21- ] ;
22- configuration . whichwrap = 'h,l' ;
20+ ] ,
21+ whichwrap : 'h,l' ,
22+ } ;
2323
24+ suite ( 'Configuration' , ( ) => {
2425 setup ( async ( ) => {
25- await setupWorkspace ( configuration ) ;
26+ await setupWorkspace ( { config : testConfig } ) ;
2627 } ) ;
2728
2829 teardown ( cleanUpWorkspace ) ;
2930
3031 test ( 'remappings are normalized' , async ( ) => {
3132 const normalizedKeybinds = srcConfiguration . configuration . normalModeKeyBindingsNonRecursive ;
3233 const normalizedKeybindsMap = srcConfiguration . configuration . normalModeKeyBindingsMap ;
33- const testingKeybinds = configuration . normalModeKeyBindingsNonRecursive ;
34+ const testingKeybinds = testConfig . normalModeKeyBindingsNonRecursive ;
3435
35- assert . strictEqual ( normalizedKeybinds . length , testingKeybinds . length ) ;
36+ assert . strictEqual ( normalizedKeybinds . length , testingKeybinds ! . length ) ;
3637 assert . strictEqual ( normalizedKeybinds . length , normalizedKeybindsMap . size ) ;
3738 assert . deepStrictEqual ( normalizedKeybinds [ 0 ] . before , [ ' ' , 'o' ] ) ;
3839 assert . deepStrictEqual ( normalizedKeybinds [ 0 ] . after , [ 'o' , '<Esc>' , 'k' ] ) ;
0 commit comments