Skip to content

Commit b12db33

Browse files
authored
Merge pull request #144 from fernando-mc/tests
Improve tests by @mikejpeters
2 parents dcbb067 + 5b89350 commit b12db33

40 files changed

+7538
-3950
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Main Workflow
1+
name: Run integration tests
2+
23
on:
34
push:
45
branches:
5-
- 'master'
6-
6+
- master
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
env:
12+
SERVERLESS_VERSION: '3.3.0'
1113
steps:
1214
- uses: aws-actions/configure-aws-credentials@v1
1315
with:
@@ -18,9 +20,5 @@ jobs:
1820
- uses: actions/setup-node@v2
1921
with:
2022
node-version: 16
21-
- uses: actions/setup-python@v2
22-
with:
23-
python-version: '3.8'
24-
- run: pip install -r test/requirements.txt
2523
- run: npm ci
26-
- run: npm test
24+
- run: npm run integration-test

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This workflow will publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Publish package to npmjs
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
registry-url: https://registry.npmjs.org/
19+
- run: npm ci
20+
- run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Run unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
env:
15+
SERVERLESS_VERSION: '3.3.0'
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: 16
21+
- run: npm ci
22+
- run: npm test

index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const path = require('path');
44
const fs = require('fs');
55

6-
const Confirm = require('enquirer');
6+
const confirm = require('@serverless/utils/inquirer/confirm');
77

88
const bucketUtils = require('./lib/bucketUtils');
99
const configure = require('./lib/configure');
@@ -100,7 +100,7 @@ class Client {
100100
manageResources = this.options.manageResources;
101101
return this.cliOptions.confirm === false
102102
? true
103-
: new Confirm(`Are you sure you want to delete bucket '${bucketName}'?`).run();
103+
: confirm(`Are you sure you want to delete bucket '${bucketName}'?`);
104104
})
105105
.then(goOn => {
106106
if (goOn) {
@@ -220,9 +220,7 @@ class Client {
220220
}
221221

222222
deployDescribe.forEach(m => this.serverless.cli.log(m));
223-
return this.cliOptions.confirm === false
224-
? true
225-
: new Confirm(`Do you want to proceed?`).run();
223+
return this.cliOptions.confirm === false ? true : confirm(`Do you want to proceed?`);
226224
})
227225
.then(goOn => {
228226
if (goOn) {
@@ -305,9 +303,7 @@ class Client {
305303
})
306304
.then(() => {
307305
this.serverless.cli.log(
308-
`Success! Your site should be available at http://${bucketName}.${
309-
regionUrls[region]
310-
}/`
306+
`Success! Your site should be available at http://${bucketName}.${regionUrls[region]}/`
311307
);
312308
});
313309
}

0 commit comments

Comments
 (0)