Skip to content

Commit

Permalink
fix(test): reformat test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Jun 11, 2021
1 parent 2d130b6 commit 72adaf7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/transform/transformVuecli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class VueCliTransformer implements Transformer {
//Base public path
config.base =
process.env.PUBLIC_URL || vueConfig.publicPath || vueConfig.baseUrl;

// css options
if (css.loaderOptions) {
config.css = {};
Expand Down Expand Up @@ -70,7 +70,7 @@ export class VueCliTransformer implements Transformer {
process.env.GENERATE_SOURCEMAP === 'true' ||
vueConfig.productionSourceMap ||
css.sourceMap;

// alias
const chainableConfig = new Config();
if (vueConfig.chainWebpack) {
Expand Down Expand Up @@ -151,7 +151,7 @@ export class VueCliTransformer implements Transformer {
plugins.push(new RawValue('vue()'));
if (context.jsx) {
context.importList.push('import vueJsx from \'@vitejs/plugin-vue-jsx\';');
plugins.push(new RawValue('envCompatible()'));
plugins.push(new RawValue('vueJsx()'));
}
}

Expand Down
58 changes: 29 additions & 29 deletions tests/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,30 @@ test('serializeObject', () => {
}
const resultB = serializeObject(objB);
expect(resultB).toMatch('{\n' +
' key1: {\n' +
' key3: false,\n' +
' key4: 0,\n' +
' key5: \'0\',\n' +
' abbreviatedKey: \'abbreviatedKey\'\n' +
' }\n' +
'}');
' key1: {\n' +
' key3: false,\n' +
' key4: 0,\n' +
' key5: \'0\',\n' +
' abbreviatedKey: \'abbreviatedKey\'\n' +
' }\n' +
'}');

const objC = {
key1: [
undefined,
null,
false,
0,
'0',
'0'
]
}
const resultC = serializeObject(objC);
expect(resultC).toMatch('{\n' +
' key1: [\n' +
' false, \n' +
' 0, \n' +
' \'0\'\n' +
' ]\n' +
' key1: [\n' +
' false,\n' +
' 0,\n' +
' \'0\'\n' +
' ]\n' +
'}'
);

Expand All @@ -83,14 +83,14 @@ test('serializeObject', () => {
}
const resultD = serializeObject(objD);
expect(resultD).toMatch('{\n' +
'key1: [\n' +
' { \n' +
' key3: false, \n' +
' key4: 0, \n' +
' key5: \'0\', \n' +
' abbreviatedKey: \'abbreviatedKey\'\n' +
' }\n' +
' ]\n' +
' key1: [\n' +
' {\n' +
' key3: false,\n' +
' key4: 0,\n' +
' key5: \'0\',\n' +
' abbreviatedKey: \'abbreviatedKey\'\n' +
' }\n' +
' ]\n' +
'}'
);

Expand All @@ -105,12 +105,12 @@ test('serializeObject', () => {
}
const resultE = serializeObject(objE);
expect(resultE).toMatch('{\n' +
' key3: function() { console.log(\'anonymous function\'); }, \n' +
' key4: function() { console.log(\'anonymous function2\'); }, \n' +
' key5: () => { console.log(\'arrow function\'); }, \n' +
' key6: () => { console.log(\'arrow function\'); }, \n' +
' key7() { console.log(\'abbreviated function\'); }, \n' +
' key8() { console.log(\'abbreviated function\'); }, \n' +
' key9() { /* key9 */ console.log(\'abbreviated function\'); } \n' +
'}');
' key3: function () { console.log(\'anonymous function\'); },\n' +
' key4: function () { console.log(\'anonymous function2\'); },\n' +
' key5: () => { console.log(\'arrow function\'); },\n' +
' key6: () => { console.log(\'arrow function\'); },\n' +
' key7() { console.log(\'abbreviated function\'); },\n' +
' key8() { console.log(\'abbreviated function\'); },\n' +
' key9() { /* key9 */ console.log(\'abbreviated function\'); }\n' +
'}');
});

0 comments on commit 72adaf7

Please sign in to comment.