1- import { describe , it , expect } from ' vitest' ;
1+ import { describe , it , expect } from " vitest" ;
22import "../fixtures" ;
33import ConfigOptions from "model/config-options" ;
44
55describe ( "model/config-options" , ( ) => {
6- it ( "should get options defaults" , ( ) => {
7- const values = { } ;
8- const options = new ConfigOptions ( values ) ;
9- const result = options . getDefaults ( ) ;
10- expect ( result . Debug ) . toBe ( false ) ;
11- expect ( result . ReadOnly ) . toBe ( false ) ;
12- expect ( result . ThumbSize ) . toBe ( 0 ) ;
13- } ) ;
6+ it ( "should get options defaults" , ( ) => {
7+ const values = { } ;
8+ const options = new ConfigOptions ( values ) ;
9+ const result = options . getDefaults ( ) ;
10+ expect ( result . Debug ) . toBe ( false ) ;
11+ expect ( result . ReadOnly ) . toBe ( false ) ;
12+ expect ( result . ThumbSize ) . toBe ( 0 ) ;
13+ } ) ;
1414
15- it ( "should test changed" , ( ) => {
16- const values = { } ;
17- const options = new ConfigOptions ( values ) ;
18- expect ( options . changed ( ) ) . toBe ( false ) ;
19- } ) ;
15+ it ( "should test changed" , ( ) => {
16+ const values = { } ;
17+ const options = new ConfigOptions ( values ) ;
18+ expect ( options . changed ( ) ) . toBe ( false ) ;
19+ } ) ;
2020
21- it ( "should load options" , async ( ) => {
22- const values = { } ;
23- const options = new ConfigOptions ( values ) ;
24- try {
25- const response = await options . load ( ) ;
26- expect ( response . success ) . toBe ( "ok" ) ;
27- } catch ( error ) {
28- // Vitest will fail the test if a promise rejects
29- throw error ;
30- }
31- expect ( options . changed ( ) ) . toBe ( false ) ;
32- } ) ;
21+ it ( "should load options" , async ( ) => {
22+ const values = { } ;
23+ const options = new ConfigOptions ( values ) ;
24+ try {
25+ const response = await options . load ( ) ;
26+ expect ( response . success ) . toBe ( "ok" ) ;
27+ } catch ( error ) {
28+ // Vitest will fail the test if a promise rejects
29+ throw error ;
30+ }
31+ expect ( options . changed ( ) ) . toBe ( false ) ;
32+ } ) ;
3333
34- it ( "should save options" , async ( ) => {
35- const values = { Debug : true } ;
36- const options = new ConfigOptions ( values ) ;
37- try {
38- const response = await options . save ( ) ;
39- expect ( response . success ) . toBe ( "ok" ) ;
40- } catch ( error ) {
41- throw error ;
42- }
43- expect ( options . changed ( ) ) . toBe ( false ) ;
44- } ) ;
45- } ) ;
34+ it ( "should save options" , async ( ) => {
35+ const values = { Debug : true } ;
36+ const options = new ConfigOptions ( values ) ;
37+ try {
38+ const response = await options . save ( ) ;
39+ expect ( response . success ) . toBe ( "ok" ) ;
40+ } catch ( error ) {
41+ throw error ;
42+ }
43+ expect ( options . changed ( ) ) . toBe ( false ) ;
44+ } ) ;
45+ } ) ;
0 commit comments