Skip to content

Commit 3865f1c

Browse files
committed
Update tests.
1 parent 765cca3 commit 3865f1c

File tree

6 files changed

+42
-48
lines changed

6 files changed

+42
-48
lines changed

test/mocha/.eslintrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/mocha/.eslintrc.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
env: {
3+
mocha: true
4+
},
5+
globals: {
6+
assertNoError: true,
7+
should: true
8+
}
9+
}

test/mocha/10-api.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
33
*/
4-
54
describe('api', () => {
65
it('should work');
76
});

test/package.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
{
2-
"name": "bedrock-module-template-http-test",
3-
"version": "0.0.1-0",
2+
"name": "@bedrock/module-template-http-test",
3+
"version": "1.0.0",
44
"private": true,
5+
"type": "module",
56
"scripts": {
67
"test": "node --preserve-symlinks test.js test",
7-
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary npm test",
8-
"coverage-ci": "cross-env NODE_ENV=test nyc --reporter=lcovonly npm test",
9-
"coverage-report": "nyc report"
8+
"coverage": "cross-env NODE_ENV=test c8 --reporter=lcov --reporter=text-summary npm test",
9+
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly npm test",
10+
"coverage-report": "c8 report"
1011
},
1112
"dependencies": {
12-
"bedrock": "^4.4.0",
13-
"bedrock-express": "^5.0.1",
14-
"bedrock-https-agent": "^2.1.0",
15-
"bedrock-module-template-http": "file:..",
16-
"bedrock-mongodb": "^8.4.0",
17-
"bedrock-server": "^3.0.0",
18-
"bedrock-test": "^5.4.0",
19-
"cross-env": "^7.0.3",
20-
"nyc": "^15.1.0"
13+
"@bedrock/core": "^6.1.3",
14+
"@bedrock/express": "^8.3.0",
15+
"@bedrock/https-agent": "^4.1.0",
16+
"@bedrock/module-template-http": "file:..",
17+
"@bedrock/server": "^5.1.0",
18+
"@bedrock/test": "^8.2.0",
19+
"c8": "^10.1.3",
20+
"cross-env": "^7.0.3"
2121
},
22-
"nyc": {
22+
"c8": {
2323
"excludeNodeModules": false,
2424
"include": [
25-
"node_modules/bedrock-module-template-http/**"
25+
"node_modules/@bedrock/bedrock-recaptcha/**"
2626
],
2727
"exclude": [
28-
"node_modules/bedrock-module-template-http/node_modules/**"
28+
"node_modules/@bedrock/bedrock-recaptcha/node_modules/**"
29+
],
30+
"reporter": [
31+
"lcov",
32+
"text-summary",
33+
"text"
2934
]
3035
}
3136
}

test/test.config.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
/*
2-
* Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved..
33
*/
4-
'use strict';
4+
import {config} from '@bedrock/core';
5+
import path from 'node:path';
56

6-
const {config} = require('bedrock');
7-
const path = require('path');
8-
9-
// MongoDB
10-
config.mongodb.name = 'bedrock_module_template_http_test';
11-
config.mongodb.dropCollections.onInit = true;
12-
config.mongodb.dropCollections.collections = [];
13-
14-
config.mocha.tests.push(path.join(__dirname, 'mocha'));
7+
config.mocha.tests.push(path.join(import.meta.dirname, 'mocha'));
158

169
// allow self-signed certs in test framework
17-
config['https-agent'].rejectUnauthorized = false;
10+
config['https-agent'].rejectUnauthorized = false;

test/test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/*
2-
* Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
33
*/
4-
'use strict';
4+
import * as bedrock from '@bedrock/core';
5+
import '@bedrock/https-agent';
6+
import '@bedrock/test';
57

6-
const bedrock = require('bedrock');
7-
require('bedrock-https-agent');
8-
require('bedrock-mongodb');
9-
require('bedrock-module-template-http');
10-
11-
require('bedrock-test');
8+
import "@bedrock/module-template-http";
129
bedrock.start();

0 commit comments

Comments
 (0)