@ciderjs/vitest-plugin-gas-mock 0.0.1 → 0.0.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.
- package/README.md +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +1 -1
- package/dist/setup.cjs +6214 -2885
- package/dist/setup.mjs +6214 -2885
- package/dist/shared/{vitest-plugin-gas-mock.DDSZt7OP.mjs → vitest-plugin-gas-mock.BJBEUt2E.mjs} +1 -1
- package/dist/shared/{vitest-plugin-gas-mock.DyNb5Y_N.cjs → vitest-plugin-gas-mock.qsVMBp-6.cjs} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Vitest plugin to mock Google Apps Script (GAS) environment.
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **Automatic Mocking**: Dynamically generates mocks based on official `@types/google-apps-script`.
|
|
13
|
+
- **Enum Support**: Includes support for GAS enums (e.g., `SpreadsheetApp.BorderStyle.SOLID`).
|
|
13
14
|
- **Method Chaining**: Supports GAS fluent APIs (e.g., `SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1')`).
|
|
14
15
|
- **Global Injection**: Automatically injects mocks into the global scope in tests.
|
|
15
16
|
- **`mockChain` Helper**: Easily override return values for complex method paths.
|
|
@@ -67,7 +68,6 @@ it('should return specific value for a chain', () => {
|
|
|
67
68
|
|
|
68
69
|
// Set the override
|
|
69
70
|
mockChain(
|
|
70
|
-
SpreadsheetApp,
|
|
71
71
|
'SpreadsheetApp.getActiveSpreadsheet.getName',
|
|
72
72
|
mockValue
|
|
73
73
|
);
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const node_path = require('node:path');
|
|
4
4
|
const node_url = require('node:url');
|
|
5
|
-
const helpers = require('./shared/vitest-plugin-gas-mock.
|
|
5
|
+
const helpers = require('./shared/vitest-plugin-gas-mock.qsVMBp-6.cjs');
|
|
6
6
|
|
|
7
7
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
8
|
const __dirname$1 = node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
package/dist/index.d.cts
CHANGED
|
@@ -4,10 +4,9 @@ declare function mockGas(): Plugin;
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 特定のメソッドチェーンの戻り値を指定した値に設定する
|
|
7
|
-
* @param root モックのルートオブジェクト(現在は使用していませんが、API互換性のために残しています)
|
|
8
7
|
* @param path 文字列によるパス記法 (例: "SpreadsheetApp.getActiveSpreadsheet.getSheetByName")
|
|
9
8
|
* @param value 返すべき値
|
|
10
9
|
*/
|
|
11
|
-
declare function mockChain(
|
|
10
|
+
declare function mockChain(path: string, value: any): void;
|
|
12
11
|
|
|
13
12
|
export { mockChain, mockGas };
|
package/dist/index.d.mts
CHANGED
|
@@ -4,10 +4,9 @@ declare function mockGas(): Plugin;
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 特定のメソッドチェーンの戻り値を指定した値に設定する
|
|
7
|
-
* @param root モックのルートオブジェクト(現在は使用していませんが、API互換性のために残しています)
|
|
8
7
|
* @param path 文字列によるパス記法 (例: "SpreadsheetApp.getActiveSpreadsheet.getSheetByName")
|
|
9
8
|
* @param value 返すべき値
|
|
10
9
|
*/
|
|
11
|
-
declare function mockChain(
|
|
10
|
+
declare function mockChain(path: string, value: any): void;
|
|
12
11
|
|
|
13
12
|
export { mockChain, mockGas };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,9 @@ declare function mockGas(): Plugin;
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 特定のメソッドチェーンの戻り値を指定した値に設定する
|
|
7
|
-
* @param root モックのルートオブジェクト(現在は使用していませんが、API互換性のために残しています)
|
|
8
7
|
* @param path 文字列によるパス記法 (例: "SpreadsheetApp.getActiveSpreadsheet.getSheetByName")
|
|
9
8
|
* @param value 返すべき値
|
|
10
9
|
*/
|
|
11
|
-
declare function mockChain(
|
|
10
|
+
declare function mockChain(path: string, value: any): void;
|
|
12
11
|
|
|
13
12
|
export { mockChain, mockGas };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
export { m as mockChain } from './shared/vitest-plugin-gas-mock.
|
|
3
|
+
export { m as mockChain } from './shared/vitest-plugin-gas-mock.BJBEUt2E.mjs';
|
|
4
4
|
|
|
5
5
|
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
function mockGas() {
|