Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: modernize tests #285

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run Vitest
run: npm test
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*eslint-env node */
'use strict';
module.exports = require('./lib/proxy');
module.exports.docker = require('./lib/docker');
module.exports.etcd = require('./lib/etcd-backend');
export * from "./lib/docker.mjs"
export * from "./lib/etcd-backend.mjs"
export * from "./lib/proxy.mjs"
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/etcd-backend.js → lib/etcd-backend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function ETCDModule(redbird, options) {
} else if (body.node.key && body.node.value && IsJsonString(body.node.value)) {
var config = JSON.parse(body.node.value);
if (typeof config.docker !== 'undefined') {
require('../')
require('..')
.docker(_this.redbird)
.register(body.node.key, body.node.value.docker, body.node.value);
} else {
Expand Down
18 changes: 9 additions & 9 deletions lib/letsencrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
*
*
*/
var leStoreConfig = {};
var webrootPath = ':configDir/:hostname/.well-known/acme-challenge';
let leStoreConfig = {};
const webrootPath = ':configDir/:hostname/.well-known/acme-challenge';

function init(certPath, port, logger) {
var http = require('http');
var path = require('path');
var url = require('url');
var fs = require('fs');
const http = require('http');
const path = require('path');
const url = require('url');
const fs = require('fs');

logger && logger.info('Initializing letsencrypt, path %s, port: %s', certPath, port);

Expand All @@ -35,7 +35,7 @@ function init(certPath, port, logger) {
workDir: ':configDir/letsencrypt/var/lib',
logsDir: ':configDir/letsencrypt/var/log',

webrootPath: webrootPath,
webrootPath,
debug: false,
};

Expand Down Expand Up @@ -79,15 +79,15 @@ function init(certPath, port, logger) {
* to avoid
*/
function getCertificates(domain, email, production, renew, logger) {
var LE = require('greenlock');
const LE = require('greenlock');
var le;

// Storage Backend
var leStore = require('le-store-certbot').create(leStoreConfig);

// ACME Challenge Handlers
var leChallenge = require('le-challenge-fs').create({
webrootPath: webrootPath,
webrootPath,
debug: false,
});

Expand Down
Loading
Loading