@mcpher/gas-fakes 1.0.23 → 1.0.25

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.
@@ -1,24 +1,33 @@
1
- import '../../main.js';
2
- import { moveToTempFolder, deleteTempFile } from './tempfolder.js';
1
+ /**
2
+ * @OnlyCurrentDoc
3
+ */
4
+ import '@mcpher/gas-fakes';
3
5
 
4
- // put all this stuff in a temp folder for easy deletion
5
- const ss = SpreadsheetApp.create("--gasmess-sheet")
6
- moveToTempFolder(ss.getId())
6
+ // the test
7
+ const test = () => {
8
+ // enable sandbox mode
9
+ ScriptApp.__behavior.sandboxMode = true;
7
10
 
8
- const sheet = ss.insertSheet()
9
- const values = [[1,2,3,'=A1+B1'],[4,5,6,'=sum(A2:c2)'],[7,8,9, '=d1+d2']]
10
- const range = sheet.getRange(1,1,values.length,values[0].length)
11
- range.setValues(values)
11
+ // create a new document
12
+ const doc = DocumentApp.create('--gas-fakes-test');
12
13
 
13
- const result = range.getDisplayValues()
14
+ // append a paragraph
15
+ const text = 'coffee turns potential into momentum.';
16
+ doc.getBody().appendParagraph(text);
17
+ doc.saveAndClose();
14
18
 
15
- console.log (result)
19
+ // read the document text and ensure it matches what you created
20
+ const readText = DocumentApp.openById(doc.getId()).getBody().getText();
16
21
 
17
- /* result is correct
18
- * [
19
- [ '1', '2', '3', '3' ],
20
- [ '4', '5', '6', '15' ],
21
- [ '7', '8', '9', '18' ]
22
- ]
23
- */
24
- deleteTempFile(ss.getId())
22
+ // check it
23
+ if (text !== readText.trim()) {
24
+ throw new Error(`expected "${text}", but got "${readText}"`);
25
+ }
26
+ console.log('document created and read back successfully');
27
+
28
+ // tidy up sandbox
29
+ ScriptApp.__behavior.trash();
30
+ }
31
+
32
+ // run the test
33
+ test();
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "brucemess",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "brucemess",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@mcpher/gas-fakes": "file:../../"
13
+ }
14
+ },
15
+ "../..": {
16
+ "name": "@mcpher/gas-fakes",
17
+ "version": "1.0.25",
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@google-cloud/logging": "^11.2.1",
21
+ "@mcpher/fake-gasenum": "^1.0.2",
22
+ "@sindresorhus/is": "^7.0.1",
23
+ "archiver": "^7.0.1",
24
+ "exceljs": "^4.4.0",
25
+ "fast-json-stable-stringify": "^2.1.0",
26
+ "get-stream": "^9.0.1",
27
+ "googleapis": "^157.0.0",
28
+ "got": "^14.4.7",
29
+ "into-stream": "^8.0.1",
30
+ "is": "^3.3.2",
31
+ "keyv": "^5.5.0",
32
+ "keyv-file": "^5.1.3",
33
+ "mime": "^4.0.7",
34
+ "sinon": "^21.0.0",
35
+ "sleep-synchronously": "^2.0.0",
36
+ "subsume": "^4.0.0",
37
+ "to-readable-stream": "^4.0.0",
38
+ "unzipper": "^0.12.3",
39
+ "yoctocolors": "^2.1.2"
40
+ },
41
+ "engines": {
42
+ "node": ">=20.11.0"
43
+ }
44
+ },
45
+ "node_modules/@mcpher/gas-fakes": {
46
+ "resolved": "../..",
47
+ "link": true
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "brucemess",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "basic.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "type": "module",
12
+ "dependencies": {
13
+ "@mcpher/gas-fakes": "file:../../"
14
+ }
15
+ }
package/mainlocal.js ADDED
@@ -0,0 +1,2 @@
1
+ // testing locally
2
+ import './src/index.js'
package/package.json CHANGED
@@ -26,49 +26,53 @@
26
26
  },
27
27
  "type": "module",
28
28
  "scripts": {
29
- "test": "cp mainlocal.js main.js && node ./test/test.js",
30
- "testdrive": "cp mainlocal.js main.js && node ./test/testdrive.js execute",
31
- "testsheetsdatavalidations": "cp mainlocal.js main.js && node ./test/testsheetsdatavalidations.js execute",
32
- "testsheetspermissions": "cp mainlocal.js main.js && node ./test/testsheetspermissions.js execute",
33
- "testsheetsvalues": "cp mainlocal.js main.js && node ./test/testsheetsvalues.js execute",
34
- "testsheets": "cp mainlocal.js main.js && node ./test/testsheets.js execute",
35
- "testfetch": "cp mainlocal.js main.js && node ./test/testfetch.js execute",
36
- "testsession": "cp mainlocal.js main.js && node ./test/testsession.js execute",
37
- "testutilities": "cp mainlocal.js main.js && node ./test/testutilities.js execute",
38
- "teststores": "cp mainlocal.js main.js && node ./test/teststores.js execute",
39
- "testscriptapp": "cp mainlocal.js main.js && node ./test/testscriptapp.js execute",
40
- "testfiddler": "cp mainlocal.js main.js && node ./test/testfiddler.js execute",
41
- "testenums": "cp mainlocal.js main.js && node ./test/testenums.js execute",
42
- "testsheetssets": "cp mainlocal.js main.js && node ./test/testsheetssets.js execute",
43
- "testsheetsvui": "cp mainlocal.js main.js && node ./test/testsheetsvui.js execute",
44
- "testsheetsdeveloper": "cp mainlocal.js main.js && node ./test/testsheetsdeveloper.js execute",
45
- "testsheetsexotics": "cp mainlocal.js main.js && node ./test/testsheetsexotics.js execute",
46
- "testsheetsdata": "cp mainlocal.js main.js && node ./test/testsheetsdata.js execute",
47
- "testdocsadv": "cp mainlocal.js main.js && node ./test/testdocsadv.js execute",
48
- "testslidesadv": "cp mainlocal.js main.js && node ./test/testslidesadv.js execute",
49
- "testform": "cp mainlocal.js main.js && node ./test/testform.js execute",
50
- "testformsadv": "cp mainlocal.js main.js && node ./test/testformsadv.js execute",
51
- "testdocs": "cp mainlocal.js main.js && node ./test/testdocs.js execute",
52
- "testslides": "cp mainlocal.js main.js && node ./test/testslides.js execute",
53
- "testdocsnext": "cp mainlocal.js main.js && node ./test/testdocsnext.js execute",
54
- "testsheetstext": "cp mainlocal.js main.js && node ./test/testsheetstext.js execute",
55
- "testsheetsrange": "cp mainlocal.js main.js && node ./test/testsheetsrange.js execute",
56
- "testdocslistitems": "cp mainlocal.js main.js && node ./test/testdocslistitems.js execute",
57
- "testdocsall": "cp mainlocal.js main.js && node ./test/testdocsall.js",
58
- "testdocsheaders": "cp mainlocal.js main.js && node ./test/testdocsheaders.js execute",
59
- "testdocsfooters": "cp mainlocal.js main.js && node ./test/testdocsfooters.js execute",
60
- "testdocsfootnotes": "cp mainlocal.js main.js && node ./test/testdocsfootnotes.js execute",
61
- "testdocsimages": "cp mainlocal.js main.js && node ./test/testdocsimages.js execute",
62
- "testdocsstyles": "cp mainlocal.js main.js && node ./test/testdocsstyles.js execute",
63
- "testsandbox": "cp mainlocal.js main.js && node ./test/testsandbox.js execute",
64
- "testgmail": "cp mainlocal.js main.js && node ./test/testgmail.js execute",
65
- "testlogger": "cp mainlocal.js main.js && node ./test/testlogger.js execute",
66
- "pub": "cp mainlocal.js main.js && npm publish --access public"
29
+ "test": "node ./test/test.js",
30
+ "testdrive": "node ./test/testdrive.js execute",
31
+ "testsheetsdatavalidations": "node ./test/testsheetsdatavalidations.js execute",
32
+ "testsheetspermissions": "node ./test/testsheetspermissions.js execute",
33
+ "testsheetsvalues": "node ./test/testsheetsvalues.js execute",
34
+ "testsheets": "node ./test/testsheets.js execute",
35
+ "testfetch": "node ./test/testfetch.js execute",
36
+ "testsession": "node ./test/testsession.js execute",
37
+ "testutilities": "node ./test/testutilities.js execute",
38
+ "teststores": "node ./test/teststores.js execute",
39
+ "testscriptapp": "node ./test/testscriptapp.js execute",
40
+ "testfiddler": "node ./test/testfiddler.js execute",
41
+ "testenums": "node ./test/testenums.js execute",
42
+ "testsheetssets": "node ./test/testsheetssets.js execute",
43
+ "testsheetsvui": "node ./test/testsheetsvui.js execute",
44
+ "testsheetsdeveloper": "node ./test/testsheetsdeveloper.js execute",
45
+ "testsheetsexotics": "node ./test/testsheetsexotics.js execute",
46
+ "testsheetsdata": "node ./test/testsheetsdata.js execute",
47
+ "testdocsadv": "node ./test/testdocsadv.js execute",
48
+ "testslidesadv": "node ./test/testslidesadv.js execute",
49
+ "testform": "node ./test/testform.js execute",
50
+ "testformsadv": "node ./test/testformsadv.js execute",
51
+ "testdocs": "node ./test/testdocs.js execute",
52
+ "testslides": "node ./test/testslides.js execute",
53
+ "testdocsnext": "node ./test/testdocsnext.js execute",
54
+ "testsheetstext": "node ./test/testsheetstext.js execute",
55
+ "testsheetsrange": "node ./test/testsheetsrange.js execute",
56
+ "testdocslistitems": "node ./test/testdocslistitems.js execute",
57
+ "testdocsall": "node ./test/testdocsall.js",
58
+ "testdocsheaders": "node ./test/testdocsheaders.js execute",
59
+ "testdocsfooters": "node ./test/testdocsfooters.js execute",
60
+ "testdocsfootnotes": "node ./test/testdocsfootnotes.js execute",
61
+ "testdocsimages": "node ./test/testdocsimages.js execute",
62
+ "testdocsstyles": "node ./test/testdocsstyles.js execute",
63
+ "testsandbox": "node ./test/testsandbox.js execute",
64
+ "testgmail": "node ./test/testgmail.js execute",
65
+ "testlogger": "node ./test/testlogger.js execute",
66
+ "pub": "npm publish --access public"
67
67
  },
68
68
  "name": "@mcpher/gas-fakes",
69
- "version": "1.0.23",
69
+ "version": "1.0.25",
70
70
  "license": "MIT",
71
- "main": "main.js && node ",
71
+ "main": "mainlocal.js",
72
+ "exports": {
73
+ ".": "./mainlocal.js",
74
+ "./main.js": "./mainlocal.js"
75
+ },
72
76
  "description": "A proof of concept implementation of Apps Script Environment on Node",
73
77
  "repository": "github:brucemcpherson/gas-fakes",
74
78
  "homepage": "https://ramblings.mcpher.com/a-proof-of-concept-implementation-of-apps-script-environment-on-node/"