Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: jsExcludes 和 cssExcludes 支持正则 #21

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

dream2023
Copy link
Contributor

@dream2023 dream2023 commented Aug 1, 2022

相关 isssue:#20
目标:支持更加灵活的 jsExcludes 和 cssExcludes

  • 代码功能
  • 文档
  • 测试用例

大佬先看以下改动的时候可以,如果可以,我再补充以下测试用例

@yiludege
Copy link
Collaborator

yiludege commented Aug 1, 2022

看了一下代码写的很棒!可以对getExcludes和isExcludeUrl写点单元测试,由于子应用的加载涉及对iframe处理,jsdom没有办法对iframe进行有效的模拟导致子应用加载失败,所以我这边大多是集成测试为主

@dream2023
Copy link
Contributor Author

看了一下代码写的很棒!可以对getExcludes和isExcludeUrl写点单元测试,由于子应用的加载涉及对iframe处理,jsdom没有办法对iframe进行有效的模拟导致子应用加载失败,所以我这边大多是集成测试为主

OK,我这边会把单元测试和 exclude 相关的集成测试都做一下

@dream2023
Copy link
Contributor Author

已经完成了,大佬可以再看一下


test('sourceType is "jsExcludes", should return jsExcludes', () => {
const jsExcludes = ['https://www.foo/a.js', /b\.js/];
const plugins = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用例都很完整,这个地方plugins为一个数组,可以给一个复杂一点的场景plugins = [{jsExcludes: jsExcludes1}, {jsExcludes: jsExcludes2}, ....]来测试验证吗。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,周末会多贡献一些代码,我看到单元测试还有很多可以补充的

@yiludege yiludege merged commit 8c902a4 into Tencent:master Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants