Skip to content

Commit ec49ca3

Browse files
committedAug 28, 2021
Depracate node 8.10. Add support for node 14.x 
1 parent 7096092 commit ec49ca3

File tree

13 files changed

+17
-13
lines changed

13 files changed

+17
-13
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
node_js:
3-
- '8.10.0'
43
- '10'
54
- '12'
5+
- '14'
66
script:
77
- npm run lint
88
- npm test

‎__tests__/config.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ xdescribe('jest configuration', () => {
9494
service: my-service
9595
provider:
9696
name: aws
97-
runtime: nodejs8.10
97+
runtime: nodejs14.x
9898
stage: dev
9999
region: us-west-1
100100
plugins:
@@ -147,7 +147,7 @@ xdescribe('jest configuration', () => {
147147
service: my-service
148148
provider:
149149
name: aws
150-
runtime: nodejs8.10
150+
runtime: nodejs14.x
151151
stage: dev
152152
region: us-west-1
153153
plugins:

‎__tests__/integration10.x.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const Serverless = require('serverless');
44
const execSync = require('child_process').execSync;
55
const path = require('path');
66
const fs = require('fs-extra');
7+
const stripAnsi = require('strip-ansi');
78
const { getTmpDirPath, replaceTextInFile, spawnPromise } = require('./test-utils');
89

910
const serverless = new Serverless();
@@ -71,8 +72,9 @@ describe('integration', () => {
7172
"require('../.serverless_plugins/serverless-jest-plugin/index.js')",
7273
);
7374
return spawnPromise(serverlessExec, 'invoke test --stage prod').then(({ stderr }) => {
74-
expect(stderr).toContain('PASS');
75-
return expect(stderr).toContain('Test Suites: 2 passed, 2 total');
75+
const rawStderr = stripAnsi(stderr);
76+
expect(rawStderr).toContain('PASS');
77+
return expect(rawStderr).toContain('Test Suites: 2 passed, 2 total');
7678
});
7779
},
7880
35000,

‎__tests__/integration12.x.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const Serverless = require('serverless');
44
const execSync = require('child_process').execSync;
55
const path = require('path');
66
const fs = require('fs-extra');
7+
const stripAnsi = require('strip-ansi');
78
const { getTmpDirPath, replaceTextInFile, spawnPromise } = require('./test-utils');
89

910
const serverless = new Serverless();
@@ -71,8 +72,9 @@ describe('integration', () => {
7172
"require('../.serverless_plugins/serverless-jest-plugin/index.js')",
7273
);
7374
return spawnPromise(serverlessExec, 'invoke test --stage prod').then(({ stderr }) => {
74-
expect(stderr).toContain('PASS');
75-
return expect(stderr).toContain('Test Suites: 2 passed, 2 total');
75+
const rawStderr = stripAnsi(stderr);
76+
expect(rawStderr).toContain('PASS');
77+
return expect(rawStderr).toContain('Test Suites: 2 passed, 2 total');
7678
});
7779
},
7880
35000,

‎__tests__/integration8.10.test.js ‎__tests__/integration14.x.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('integration', () => {
1616
process.env.PLUGIN_TEST_DIR = path.join(__dirname);
1717
const tmpDir = getTmpDirPath();
1818
fs.mkdirsSync(tmpDir);
19-
fs.copySync(path.join(process.env.PLUGIN_TEST_DIR, 'test-service8.10'), tmpDir);
19+
fs.copySync(path.join(process.env.PLUGIN_TEST_DIR, 'test-service14.x'), tmpDir);
2020
const packageJsonPath = path.join(tmpDir, 'package.json');
2121
const packageJson = fs.readJsonSync(packageJsonPath);
2222
packageJson.name = `application-${Date.now()}`;

‎__tests__/test-service-options/serverless.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ service: jest-test-suite
1919

2020
provider:
2121
name: aws
22-
runtime: nodejs8.10
22+
runtime: nodejs14.x
2323
environment:
2424
STAGE: ${opt:stage}-stage-test
2525
stage: dev
File renamed without changes.
File renamed without changes.

‎__tests__/test-service8.10/package.json ‎__tests__/test-service14.x/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "application-name-8",
2+
"name": "application-name-12",
33
"version": "0.0.1",
44
"dependencies": {
55
"serverless-jest-plugin": ""

‎__tests__/test-service8.10/serverless.yml ‎__tests__/test-service14.x/serverless.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ service: jest-test-suite
1919

2020
provider:
2121
name: aws
22-
runtime: nodejs8.10
22+
runtime: nodejs14.x
2323
stage: dev
2424
region: us-east-1
2525

‎__tests__/utils.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const path = require('path');
44
const fs = require('fs-extra');
5-
const utils = require('../lib/utils.js');
5+
const utils = require('../lib/utils');
66
const testUtils = require('../__tests__/test-utils');
77

88
describe('utils', () => {

‎lib/create-function.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const ejs = require('ejs');
99
const functionTemplateFile = path.join('templates', 'function-template.ejs');
1010

1111
const validFunctionRuntimes = [
12-
'aws-nodejs8.10',
1312
'aws-nodejs10.x',
1413
'aws-nodejs12.x',
14+
'aws-nodejs14.x',
1515
];
1616

1717
const humanReadableFunctionRuntimes = `${validFunctionRuntimes

0 commit comments

Comments
 (0)
Please sign in to comment.