Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit 5c17375

Browse files
committed
test: setup
1 parent 7c6d215 commit 5c17375

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.idea
22
node_modules
3-

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/dominykas/allow-scripts.git"
88
},
99
"scripts": {
10-
"test": "lab -L -n"
10+
"test": "lab -L -t 73 -m 5000"
1111
},
1212
"bin": {
1313
"allow-scripts": "./bin/allow-scripts.js"
@@ -20,8 +20,10 @@
2020
"topo": "3.x.x"
2121
},
2222
"devDependencies": {
23+
"code": "5.x.x",
2324
"lab": "18.x.x",
24-
"semantic-release": "15.x.x"
25+
"semantic-release": "15.x.x",
26+
"sinon": "7.x.x"
2527
},
2628
"files": [
2729
"bin",

test/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
const Sinon = require('sinon');
4+
5+
const Allow = require('..');
6+
7+
const { describe, it, beforeEach, afterEach } = exports.lab = require('lab').script();
8+
const { expect } = require('code');
9+
10+
describe('allow-scripts', () => {
11+
12+
describe('run()', () => {
13+
14+
beforeEach(() => {
15+
16+
Sinon.stub(console, 'log');
17+
});
18+
19+
afterEach(() => {
20+
21+
Sinon.restore();
22+
});
23+
24+
it('executes allowed scripts', async () => {
25+
26+
await Allow.run({});
27+
28+
expect(true).to.equal(true);
29+
});
30+
});
31+
});

0 commit comments

Comments
 (0)