Skip to content

Commit

Permalink
✅ 同步更新测试及示例
Browse files Browse the repository at this point in the history
  • Loading branch information
vanishcode committed Sep 15, 2021
1 parent 4aee074 commit 4f94528
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 4 additions & 2 deletions __tests__/scoped-css.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ describe('test preparse function', () => {
const resourcePath = '/path/to/test.san';
const id = hash(resourcePath);

expect(preparse(source, resourcePath)).toEqual(
expect(preparse(source, resourcePath, true)).toEqual(
'<template><span data-s-'
+ id
+ '>sanjs</span></template><style scoped>span[data-s-'
+ id
+ ']{color:pink}</style>'
+ '<script>export default {};</script>'
);
});

Expand All @@ -33,12 +34,13 @@ describe('test preparse function', () => {
const resourcePath = '/path/to/test.san';
const id = hash(resourcePath);

expect(preparse(source, resourcePath)).toEqual(
expect(preparse(source, resourcePath, true)).toEqual(
'<template><span class="red" data-s-'
+ id
+ '>sanjs</span></template><style scoped>.red[data-s-'
+ id
+ ']{color:pink}</style>'
+ '<script>export default {};</script>'
);
});

Expand Down
7 changes: 0 additions & 7 deletions examples/hmr/src/components/comp-pug.san
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,3 @@
.awesome-class
h1 Hello {{world}}!
</template>
<script>
export default {
initData() {
return {}
}
}
</script>
3 changes: 2 additions & 1 deletion examples/hmr/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module.exports = {
// 上面为测试+示例,下面为实际使用
// loader: 'san-loader'
options: {
compileTemplate: 'none'
compileTemplate: 'none',
autoAddScriptTag: true,
}
}
]
Expand Down

0 comments on commit 4f94528

Please sign in to comment.