File tree Expand file tree Collapse file tree 2 files changed +15
-45
lines changed Expand file tree Collapse file tree 2 files changed +15
-45
lines changed Original file line number Diff line number Diff line change 11import type { BemInGeneral } from "./bem.types"
2- import type { BemOptions } from "./bem.core" ;
32import {
43 bem2arr ,
5- getOptions ,
64 setOptions
75} from "./bem.core" ;
86
@@ -33,43 +31,23 @@ describe(bem2arr.name, () => {
3331} )
3432
3533describe ( "optioning" , ( ) => {
36- const defaultOpts : BemOptions = {
34+ afterAll ( ( ) => setOptions ( {
3735 elementDelimiter : "__" ,
3836 modDelimiter : "--" ,
39- }
37+ } ) )
4038
41- it ( "default" , ( ) => expect (
42- getOptions ( )
43- ) . toStrictEqual (
44- defaultOpts
45- ) )
46-
47- it ( "set empty" , ( ) => expect ( (
48- setOptions ( { } ) ,
49- getOptions ( )
50- ) ) . toStrictEqual (
51- defaultOpts
52- ) )
53-
54- it ( "set another" , ( ) => {
55- //TODO #29 test bem with not default options
56- const opts : BemOptions = {
57- elementDelimiter : "_" ,
58- modDelimiter : "-" ,
59- }
60- setOptions ( opts )
61-
62- expect (
63- getOptions ( )
64- ) . toStrictEqual (
65- opts
39+ it ( "another mod" , ( ) => {
40+ setOptions ( { modDelimiter : "-" } )
41+ expect ( bem2arr ( {
42+ base : { mod : "val" }
43+ } ) . join ( " " ) ) . toBe (
44+ "base base-mod-val"
6645 )
6746 } )
6847
69- it ( "revert to default" , ( ) => expect ( (
70- setOptions ( defaultOpts ) ,
71- getOptions ( )
72- ) ) . toStrictEqual (
73- defaultOpts
74- ) )
75- } )
48+ it ( "another el" , ( ) => {
49+ //#Useful in #30
50+ setOptions ( { elementDelimiter : "_" } )
51+ expect ( true ) . toBe ( true )
52+ } )
53+ } )
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ export type BemOptions = {
1212
1313export {
1414 bem2arr ,
15- setOptions ,
16- getOptions
15+ setOptions
1716}
1817
1918function bem2arr ( query : BemInGeneral ) {
@@ -62,10 +61,3 @@ function setOptions({
6261 modDelimiter = modDel
6362 elementDelimiter = elD
6463}
65-
66- function getOptions ( ) {
67- return {
68- elementDelimiter,
69- modDelimiter,
70- }
71- }
You can’t perform that action at this time.
0 commit comments