-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #1218 finish serverless, update tests
- Loading branch information
Cuong Vu
committed
May 20, 2020
1 parent
5b61910
commit c3d6114
Showing
14 changed files
with
173 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const yargs = require('yargs') | ||
const { spawn } = require('child_process') | ||
|
||
const stage = yargs.argv.stage | ||
|
||
// relative to the root of web-components package | ||
const listServerlessYmlFiles = ['src/search-widget/server/serverless.yml'] | ||
|
||
const buildServerlessList = () => { | ||
listServerlessYmlFiles.forEach(file => { | ||
const build = spawn('serverless', ['webpack', '--config', file, '--out', 'dist', '--stage', stage]) | ||
build.stdout.on('data', function(data) { | ||
console.info('stdout: ' + data.toString()) | ||
}) | ||
|
||
build.stderr.on('data', function(data) { | ||
console.error('stderr: ' + data.toString()) | ||
}) | ||
|
||
build.on('exit', function(code) { | ||
console.info(`Building ${file} exited with code ${code.toString()}`) | ||
}) | ||
|
||
build.on('error', function(err) { | ||
console.error(`An error happened \n${err}`) | ||
process.exit(1) | ||
}) | ||
}) | ||
} | ||
|
||
buildServerlessList() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
const path = require('path') | ||
const yargs = require('yargs') | ||
const { spawn } = require('child_process') | ||
|
||
const stage = yargs.argv.stage | ||
|
||
const listServerlessYmlFiles = [path.resolve(__dirname, '../src/search-widget/server/serverless.yml')] | ||
// relative to the root of web-components package | ||
const listServerlessYmlFiles = ['src/search-widget/server/serverless.yml'] | ||
|
||
const deployServerless = async () => {} | ||
const deployServerlessList = () => { | ||
listServerlessYmlFiles.forEach(file => { | ||
const deploy = spawn('serverless', ['deploy', '--config', file, '--stage', stage]) | ||
deploy.stdout.on('data', function(data) { | ||
console.info('stdout: ' + data.toString()) | ||
}) | ||
|
||
deploy.stderr.on('data', function(data) { | ||
console.error('stderr: ' + data.toString()) | ||
}) | ||
|
||
deploy.on('exit', function(code) { | ||
console.info(`Deploying ${file} exited with code ${code.toString()}`) | ||
}) | ||
|
||
deploy.on('error', function(err) { | ||
console.error(`An error happened \n${err}`) | ||
process.exit(1) | ||
}) | ||
}) | ||
} | ||
|
||
deployServerlessList() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 100 additions & 1 deletion
101
...omponents/src/appointment-bookings/client/core/__tests__/__snapshots__/index.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,102 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ReapitAppointmentBookingComponent should match a snapshot 1`] = `undefined`; | ||
exports[`ReapitAppointmentBookingComponent should match a snapshot 1`] = ` | ||
Appointment_bookings { | ||
"$$": Object { | ||
"after_update": Array [], | ||
"before_update": Array [], | ||
"bound": Object {}, | ||
"callbacks": Object {}, | ||
"context": Map {}, | ||
"ctx": Array [ | ||
false, | ||
1, | ||
[Function], | ||
[Function], | ||
[Function], | ||
[Function], | ||
Object { | ||
"bodyText": "css-kj8hgc", | ||
"button": "css-1dv0ljc", | ||
"dateCellHeader": "css-emo7go", | ||
"formBlock": "css-ebxsuw", | ||
"formButtonPrimary": "css-1lxnn63", | ||
"formButtonSecondary": "css-rjv3cy", | ||
"formError": "css-91pmmi", | ||
"formHeader": "css-xk00h3", | ||
"formInput": "css-l0zla6", | ||
"formLabel": "css-1hy6hob", | ||
"formSeparator": "css-yulbtv", | ||
"globalStyles": "css-11c02ub", | ||
"input": "css-90jyro", | ||
"offerBanner": "css-1u7x4xu", | ||
"pagination": "css-1ml0awe", | ||
"paginationActive": "css-1ml0awe", | ||
"primaryHeading": "css-1vpwbmy", | ||
"primaryStrapline": "css-1k1azsg", | ||
"resultItem": "css-hxgn9z", | ||
"searchBox": "css-1kkxuu3", | ||
"secondaryHeading": "css-x83nk", | ||
"secondaryStrapline": "css-1ts0wow", | ||
"selectedItem": "css-1uqw7mn", | ||
"svgNavigation": "css-1r1r46p", | ||
"timeCell": "css-5hl7fz", | ||
"timeCellsContainer": "css-1fswrvx", | ||
}, | ||
Object { | ||
"baseBackgroundColor": "#f9fbfd", | ||
"baseFontFamily": "\\"Roboto\\", sans-serif", | ||
"basefontColor": "#12263f", | ||
"basefontSize": "14px", | ||
"breakPoints": Object { | ||
"desktop": "", | ||
"laptop": "", | ||
"mobile": "", | ||
"tablet": "", | ||
}, | ||
"dateCellHeaderBackgroundColor": "#ececec", | ||
"formButtonFontSize": "1.2rem", | ||
"formHrSeparatorFontColor": "#e6e6e6", | ||
"formLabelColor": "#737373", | ||
"headingFontFamily": "\\"Open Sans\\", sans-serif", | ||
"inverseFontColor": "#f9fbfd", | ||
"mapAccentColor": "#7bc9eb", | ||
"navigateButtonColor": "red", | ||
"primaryAccentColor": "#0061a8", | ||
"primaryHeadingFontSize": "24px", | ||
"searchPlaceholder": "e.g. London or EC1N", | ||
"secondaryAccentColor": "#1e2554", | ||
"secondaryHeadingFontSize": "20px", | ||
"secondaryfontColor": "#1e2554", | ||
"timeCellBackgroundColor": "#dfdfdf", | ||
"timeCellBackgroundColorHover": "#d3d3d3", | ||
"timeCellsContainerBackgroundColor": "#f9f9f9", | ||
}, | ||
"body", | ||
], | ||
"dirty": Array [ | ||
-1, | ||
], | ||
"fragment": Object { | ||
"c": [Function], | ||
"d": [Function], | ||
"i": [Function], | ||
"l": [Function], | ||
"m": [Function], | ||
"o": [Function], | ||
"p": [Function], | ||
}, | ||
"not_equal": [Function], | ||
"on_destroy": Array [], | ||
"on_mount": Array [], | ||
"props": Object { | ||
"parentSelector": 8, | ||
"theme": 7, | ||
}, | ||
"update": [Function], | ||
}, | ||
"$capture_state": [Function], | ||
"$inject_state": [Function], | ||
"$set": [Function], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/web-components/src/search-widget/server/serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters