Skip to content

Commit

Permalink
refactor: refactor the serializer module from silent hook
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed May 28, 2023
1 parent 87d2600 commit 598eb95
Show file tree
Hide file tree
Showing 43 changed files with 1,331 additions and 420 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Response upon submission, greatly reducing the impact of network fluctuations, a

## What's next?

As mentioned above, the mission of alova is to propose better request management solutions for different request scenarios, and solutions for specific scenarios will be found in [**alovajs/scene**](https://github.com/alovajs/ scene), if you have an expected request scene, welcome to discuss it through [issue](https://github.com/alovajs/extensions/issues), and welcome to contribute your ingenuity through [pull requests](https://github.com/alovajs/extensions/pulls) to make alova better together.
As mentioned above, the mission of alova is to propose better request management solutions for different request scenarios, and solutions for specific scenarios will be found in [**alovajs/scene**](https://github.com/alovajs/scene), if you have an expected request scene, welcome to discuss it through [issue](https://github.com/alovajs/scene/issues), and welcome to contribute your ingenuity through [pull requests](https://github.com/alovajs/scene/pulls) to make alova better together.

## LICENSE

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

## 下一步做什么?

就像上面所说,alova 的使命是针对不同的请求场景提出更好的请求管理方案,特定场景的方案将会在 [**alovajs/scene**](https://github.com/alovajs/scene) 中实现,如果你有期待的请求场景,欢迎通过 [issue](https://github.com/alovajs/extensions/issues) 来讨论,也欢迎贡献你的聪明才智,通过 [pull requests](https://github.com/alovajs/extensions/pulls) 来一起让 alova 变得更好。
就像上面所说,alova 的使命是针对不同的请求场景提出更好的请求管理方案,特定场景的方案将会在 [**alovajs/scene**](https://github.com/alovajs/scene) 中实现,如果你有期待的请求场景,欢迎通过 [issue](https://github.com/alovajs/scene/issues) 来讨论,也欢迎贡献你的聪明才智,通过 [pull requests](https://github.com/alovajs/scene/pulls) 来一起让 alova 变得更好。

## LICENSE

Expand Down
17 changes: 13 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ export default {
'tsx',
'json',
'node',
'svelte'
'svelte',
'vue'
],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
'~/(.*)': '<rootDir>/$1',
'#/(.*)': '<rootDir>/test/$1'
'#/(.*)': '<rootDir>/test/$1',
'^vue$': 'vue/dist/vue.cjs.js'
},

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
Expand Down Expand Up @@ -142,11 +144,17 @@ export default {
// The test environment that will be used for testing
testEnvironment: 'jsdom',

// resolve the problem that `Vue is not define` in `@testing-library/vue`
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons']
},

testMatch: [
'**/test/**/*.spec.[tj]s?(x)'
// '**/test/modules/uuid.spec.ts(x)?'
// '**/test/modules/serializer.spec.ts(x)?'
// '**/test/silent/virtualResponse.spec.ts(x)?'
// '**/test/silent/serializers.spec.ts(x)?'
// '**/test/silent/serializedStorage.spec.ts(x)?'
// '**/test/silent/bootSilentQueue.spec.ts(x)?'
// '**/test/silent/methodQueue-silent-request.spec.ts(x)?'
// '**/test/silent/methodQueue-requestWait.spec.ts(x)?'
Expand Down Expand Up @@ -215,7 +223,8 @@ export default {
}
}
],
'^.+\\.svelte$': 'svelte-jester'
'^.+\\.svelte$': 'svelte-jester',
'^.+\\.vue$': '@vue/vue3-jest'
},

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
Expand Down
Loading

0 comments on commit 598eb95

Please sign in to comment.