@relevate/poolster-plugin-msw 0.5.0-alpha.1 → 0.5.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +2 -2
  2. package/index.d.ts +2 -2
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  function pluginMsw(options = {}) {
4
4
  if (!options || typeof options !== 'object' || Array.isArray(options)) throw new TypeError('pluginMsw options must be an object');
5
- for (const key of Object.keys(options)) if (key !== 'target' && key !== 'output') throw new TypeError('unknown pluginMsw option ' + key);
5
+ for (const key of Object.keys(options)) if (key !== 'target' && key !== 'output' && !(key === 'fixtureOptions' && ['faker','msw','cypress'].includes('msw')) && !(key === 'cypressOptions' && 'msw' === 'cypress')) throw new TypeError('unknown pluginMsw option ' + key);
6
6
  if (options.target != null && (typeof options.target !== 'string' || !options.target)) throw new TypeError('target must be a nonempty string');
7
7
  if (options.output != null && (typeof options.output !== 'string' || !options.output)) throw new TypeError('output must be a nonempty string');
8
- return { kind: 'native-addon', name: '@relevate/poolster-plugin-msw', plugin: 'msw', target: options.target ?? 'typescript', ...(options.output ? { output: options.output } : {}) };
8
+ return { kind: 'native-addon', name: '@relevate/poolster-plugin-msw', plugin: 'msw', target: options.target ?? 'typescript', ...(options.output ? { output: options.output } : {}), ...(options.fixtureOptions !== undefined ? { fixtureOptions: options.fixtureOptions } : {}), ...(options.cypressOptions !== undefined ? { cypressOptions: options.cypressOptions } : {}) };
9
9
  }
10
10
 
11
11
  module.exports = { pluginMsw };
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { NativeAddon } from '@relevate/poolster';
1
+ import type { NativeAddon, FixtureOptions, CypressOptions } from '@relevate/poolster';
2
2
 
3
- export interface MswPluginOptions { target?: string; output?: string }
3
+ export interface MswPluginOptions { target?: string; output?: string; fixtureOptions?: FixtureOptions }
4
4
  export function pluginMsw(options?: MswPluginOptions): NativeAddon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relevate/poolster-plugin-msw",
3
- "version": "0.5.0-alpha.1",
3
+ "version": "0.5.0-alpha.2",
4
4
  "description": "Poolster plugin exports for msw",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "node": ">=18"
28
28
  },
29
29
  "peerDependencies": {
30
- "@relevate/poolster": "0.5.0-alpha.1"
30
+ "@relevate/poolster": "0.5.0-alpha.2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"