Move to ESModules for local run and adds testing library

This commit is contained in:
Julien Lengrand-Lambert
2023-03-08 14:53:39 +01:00
parent 12e7a65848
commit fe21aa35f7
13 changed files with 269 additions and 6216 deletions

View File

@@ -14,7 +14,7 @@ jobs:
id: changed-files-specific id: changed-files-specific
uses: tj-actions/changed-files@v35 uses: tj-actions/changed-files@v35
with: with:
files: tests/*.yml files: samples/*.yml
- name: push-adyen-collections-to-postman-javascript-action - name: push-adyen-collections-to-postman-javascript-action
id: process id: process
uses: jlengrand/push-adyen-collections-to-postman-javascript-action@main uses: jlengrand/push-adyen-collections-to-postman-javascript-action@main

433
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,8 @@
const postman = require('./postmanLibrary'); import * as postman from './postmanLibrary.js';
const util = require('util') import * as dotenv from 'dotenv';
require('dotenv').config() import * as util from 'util';
dotenv.config();
const POSTMAN_API_KEY = process.env.POSTMAN_API_KEY; const POSTMAN_API_KEY = process.env.POSTMAN_API_KEY;
const POSTMAN_WORKSPACE_ID = process.env.POSTMAN_WORKSPACE_ID; const POSTMAN_WORKSPACE_ID = process.env.POSTMAN_WORKSPACE_ID;

6019
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,9 @@
"version": "0.1", "version": "0.1",
"description": "This action will push the Adyen collections to Postman.", "description": "This action will push the Adyen collections to Postman.",
"main": "index.js", "main": "index.js",
"type": "module",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "uvu tests",
"local": "node localRun.js", "local": "node localRun.js",
"build": "ncc build index.js --license licenses.txt", "build": "ncc build index.js --license licenses.txt",
"prepare": "husky install" "prepare": "husky install"
@@ -27,6 +28,7 @@
"dotenv": "^16.0.3" "dotenv": "^16.0.3"
}, },
"devDependencies": { "devDependencies": {
"husky": "^8.0.0" "husky": "^8.0.0",
"uvu": "^0.5.6"
} }
} }

View File

@@ -1,6 +1,6 @@
const https = require('https'); import * as https from 'https';
exports.getWorkspace= async function(workspaceId, postmanApiKey) { export async function getWorkspace(workspaceId, postmanApiKey) {
const options = { const options = {
hostname: 'api.getpostman.com', hostname: 'api.getpostman.com',
port: 443, port: 443,

3
sort.js Normal file
View File

@@ -0,0 +1,3 @@
export function list(){
return [];
}

10
tests/sort.js Normal file
View File

@@ -0,0 +1,10 @@
import { test } from 'uvu';
import * as assert from 'uvu/assert';
import {list} from '../sort.js';
test('sort.list', () => {
assert.equal(list(), []);
});
test.run();