Skip to content

Commit

Permalink
delete function in test/000_debug.test.js before running tests on Git…
Browse files Browse the repository at this point in the history
…Hub CI #85
  • Loading branch information
nelsonic committed Feb 3, 2024
1 parent 2a1e055 commit e3c1f26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ module.exports = function upload (pkg, callback) {
pkg = PKG
}
const FUNCTION_NAME = utils.functionName(pkg);
console.log('FUNCTION_NAME:', FUNCTION_NAME);

// try {
lambda.getFunction({ FunctionName: FUNCTION_NAME }, function (err, data) {
if (err) { // if the function does not already exist we create it.
Expand Down
22 changes: 18 additions & 4 deletions test/000_debug.test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
// var path = require('path');
// var aguid = require('aguid');
// var fs = require('fs');
//
var utils = require('../lib/utils');
const basepath = utils.getBasepath();
console.log('utils.getBasepath(process.cwd())', utils.getBasepath(process.cwd()));

const PKG = require(basepath + 'package.json');
const FUNCTION_NAME = utils.functionName(PKG);
console.log('FUNCTION_NAME:', FUNCTION_NAME);

const AWS = require('aws-sdk');
AWS.config.region = process.env.AWS_REGION; // set your Environment Variables...
const lambda = new AWS.Lambda();
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
// console.log(process);
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
// console.log('__dirname:', __dirname);
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
// console.log('process.cwd():', process.cwd());
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
//
var utils = require('../lib/utils');
console.log('utils.getBasepath(process.cwd())', utils.getBasepath(process.cwd()));
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
// console.log('utils.getBasepath()', utils.getBasepath());
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
//
console.log('process.env.TMPDIR:', process.env.TMPDIR, '(BEFORE)');
console.log(' - - - - - - - - - - - - - - - - - - - - - - ');

lambda.deleteFunction({ FunctionName: FUNCTION_NAME }, function (err, data) {
console.log('- - - - - - - - - DELETE Before Running Tests - - - - - ');
console.log('err:', err);
console.log('- - - - - - - - -');
console.log('data:', data);
});
// process.env.TMPDIR = process.env.TMPDIR || path.resolve(process.cwd(), '../') + '/';
// console.log('process.env.TMPDIR:', process.env.TMPDIR, '(SET)');
// console.log(' - - - - - - - - - - - - - - - - - - - - - - ');
Expand Down

0 comments on commit e3c1f26

Please sign in to comment.