Skip to content

Commit

Permalink
Depracate node 8.10. Add support for node 14.x 
Browse files Browse the repository at this point in the history
  • Loading branch information
artoliukkonen committed Aug 28, 2021
1 parent 7096092 commit ec49ca3
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- '8.10.0'
- '10'
- '12'
- '14'
script:
- npm run lint
- npm test
4 changes: 2 additions & 2 deletions __tests__/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ xdescribe('jest configuration', () => {
service: my-service
provider:
name: aws
runtime: nodejs8.10
runtime: nodejs14.x
stage: dev
region: us-west-1
plugins:
Expand Down Expand Up @@ -147,7 +147,7 @@ xdescribe('jest configuration', () => {
service: my-service
provider:
name: aws
runtime: nodejs8.10
runtime: nodejs14.x
stage: dev
region: us-west-1
plugins:
Expand Down
6 changes: 4 additions & 2 deletions __tests__/integration10.x.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Serverless = require('serverless');
const execSync = require('child_process').execSync;
const path = require('path');
const fs = require('fs-extra');
const stripAnsi = require('strip-ansi');
const { getTmpDirPath, replaceTextInFile, spawnPromise } = require('./test-utils');

const serverless = new Serverless();
Expand Down Expand Up @@ -71,8 +72,9 @@ describe('integration', () => {
"require('../.serverless_plugins/serverless-jest-plugin/index.js')",
);
return spawnPromise(serverlessExec, 'invoke test --stage prod').then(({ stderr }) => {
expect(stderr).toContain('PASS');
return expect(stderr).toContain('Test Suites: 2 passed, 2 total');
const rawStderr = stripAnsi(stderr);
expect(rawStderr).toContain('PASS');
return expect(rawStderr).toContain('Test Suites: 2 passed, 2 total');
});
},
35000,
Expand Down
6 changes: 4 additions & 2 deletions __tests__/integration12.x.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Serverless = require('serverless');
const execSync = require('child_process').execSync;
const path = require('path');
const fs = require('fs-extra');
const stripAnsi = require('strip-ansi');
const { getTmpDirPath, replaceTextInFile, spawnPromise } = require('./test-utils');

const serverless = new Serverless();
Expand Down Expand Up @@ -71,8 +72,9 @@ describe('integration', () => {
"require('../.serverless_plugins/serverless-jest-plugin/index.js')",
);
return spawnPromise(serverlessExec, 'invoke test --stage prod').then(({ stderr }) => {
expect(stderr).toContain('PASS');
return expect(stderr).toContain('Test Suites: 2 passed, 2 total');
const rawStderr = stripAnsi(stderr);
expect(rawStderr).toContain('PASS');
return expect(rawStderr).toContain('Test Suites: 2 passed, 2 total');
});
},
35000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('integration', () => {
process.env.PLUGIN_TEST_DIR = path.join(__dirname);
const tmpDir = getTmpDirPath();
fs.mkdirsSync(tmpDir);
fs.copySync(path.join(process.env.PLUGIN_TEST_DIR, 'test-service8.10'), tmpDir);
fs.copySync(path.join(process.env.PLUGIN_TEST_DIR, 'test-service14.x'), tmpDir);
const packageJsonPath = path.join(tmpDir, 'package.json');
const packageJson = fs.readJsonSync(packageJsonPath);
packageJson.name = `application-${Date.now()}`;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/test-service-options/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ service: jest-test-suite

provider:
name: aws
runtime: nodejs8.10
runtime: nodejs14.x
environment:
STAGE: ${opt:stage}-stage-test
stage: dev
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "application-name-8",
"name": "application-name-12",
"version": "0.0.1",
"dependencies": {
"serverless-jest-plugin": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ service: jest-test-suite

provider:
name: aws
runtime: nodejs8.10
runtime: nodejs14.x
stage: dev
region: us-east-1

Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const path = require('path');
const fs = require('fs-extra');
const utils = require('../lib/utils.js');
const utils = require('../lib/utils');
const testUtils = require('../__tests__/test-utils');

describe('utils', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/create-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const ejs = require('ejs');
const functionTemplateFile = path.join('templates', 'function-template.ejs');

const validFunctionRuntimes = [
'aws-nodejs8.10',
'aws-nodejs10.x',
'aws-nodejs12.x',
'aws-nodejs14.x',
];

const humanReadableFunctionRuntimes = `${validFunctionRuntimes
Expand Down

0 comments on commit ec49ca3

Please sign in to comment.