Skip to content

Commit

Permalink
chore: modernize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Sep 10, 2024
1 parent cb7781e commit e6afe2f
Show file tree
Hide file tree
Showing 19 changed files with 2,620 additions and 5,168 deletions.
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

0 comments on commit e6afe2f

Please sign in to comment.