Skip to content

Commit 8ec280f

Browse files
committed
test: fixed after add config plugins, #288
1 parent de59985 commit 8ec280f

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

test/config/.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
'posthtml-bem': {}
2+
'plugins': {
3+
'posthtml-bem': {}
4+
}
35
}

test/fixtures/.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"posthtml-custom-elements": {
3-
"defaultTag": "span"
2+
"plugins": {
3+
"posthtml-custom-elements": {
4+
"defaultTag": "span"
5+
}
46
}
57
}

test/fixtures/config-for-bem.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"bem": {
2+
"plugins": {
3+
"posthtml-bem": {
34
"elemPrefix": "__",
45
"modPrefix": "-",
56
"modDlmtr": "--"
67
},
7-
"customElements": {
8+
"posthtml-custom-elements": {
89
"defaultTag": "span"
910
}
11+
}
1012
}

test/fixtures/config.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"posthtml-custom-elements": {
3-
"defaultTag": "span"
4-
}
2+
"plugins": {
3+
"posthtml-custom-elements": {
4+
"defaultTag": "span"
5+
}
6+
}
57
}

test/test-cfg-resolve.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('should return config with one use key without property', async t => {
1515
use: 'posthtml-bem'
1616
};
1717
const config = await cfgResolve(flags);
18-
const expected = {'posthtml-bem': {}};
18+
const expected = {plugins: {'posthtml-bem': {}}};
1919

2020
t.deepEqual(config, expected);
2121
});
@@ -28,7 +28,7 @@ test('should return config with one use key with one property', async t => {
2828
}
2929
};
3030
const config = await cfgResolve(flags);
31-
const expected = {'posthtml-bem': {prefix: '__'}};
31+
const expected = {plugins: {'posthtml-bem': {prefix: '__'}}};
3232

3333
t.deepEqual(config, expected);
3434
});
@@ -38,7 +38,7 @@ test('should return config with key config', async t => {
3838
config: 'test/config/.config'
3939
};
4040
const config = await cfgResolve(flags);
41-
const expected = {'posthtml-bem': {}};
41+
const expected = {plugins: {'posthtml-bem': {}}};
4242

4343
t.deepEqual(config, expected);
4444
});
@@ -49,7 +49,7 @@ test('should return config with key config and use key', async t => {
4949
config: 'test/config/.config'
5050
};
5151
const config = await cfgResolve(flags);
52-
const expected = {'posthtml-bem': {}, 'posthtml-assets': {}};
52+
const expected = {plugins: {'posthtml-bem': {}, 'posthtml-assets': {}}};
5353

5454
t.deepEqual(config, expected);
5555
});

0 commit comments

Comments
 (0)