Skip to content

Commit 0af7ef9

Browse files
authored
feat: Exported Page class to support unit testing of SmartApps (#206)
1 parent 19c4152 commit 0af7ef9

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22
const SmartApp = require('./lib/smart-app')
3+
const Page = require('./lib/pages/page')
34

45
module.exports = SmartApp
56
module.exports.SmartApp = SmartApp
7+
module.exports.Page = Page

lib/pages/page.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export class Page {
5858
*/
5959
style(value: PageStyle): Page
6060

61+
/**
62+
* Returns the page definition as a JSON object. Exported to support unit testing. Otherwise not used in writing
63+
* SmartApps
64+
*/
65+
toJson(): any
66+
6167
protected i18nKey(value: string): string
6268
protected translate(...args: any): Page
6369
}

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/aws-lambda": "^8.10.51",
3939
"@types/i18n": "^0.8.6",
4040
"async-mutex": "^0.1.4",
41-
"axios": "^0.21.1",
41+
"axios": "^0.21.4",
4242
"fs-extra": "~7.0.1",
4343
"http-signature": "~1.2.0",
4444
"i18n": "~0.8.5",

0 commit comments

Comments
 (0)