Skip to content

Commit 5f55bb4

Browse files
committedJun 4, 2020
chore: Update dependencies
1 parent 2da9d6f commit 5f55bb4

40 files changed

+3039
-2659
lines changed
 

‎.prettierrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
35
}

‎__tests__/bin-readme.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function documentation(args, options, parseJSON) {
2222
});
2323
}
2424

25-
describe('readme autodetection of different filenames', function() {
25+
describe('readme autodetection of different filenames', function () {
2626
const fixtures = path.join(__dirname, 'fixture/readme');
2727
const sourceFile = path.join(fixtures, 'index.js');
2828
let d;
@@ -38,14 +38,14 @@ describe('readme autodetection of different filenames', function() {
3838
fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js'));
3939
});
4040

41-
test('updates readme.markdown', async function() {
41+
test('updates readme.markdown', async function () {
4242
await documentation(['readme index.js -s API'], { cwd: d });
4343
const outputPath = path.join(d, 'readme.markdown');
4444
expect(fs.readFileSync(outputPath, 'utf-8')).toMatchSnapshot();
4545
});
4646
});
4747

48-
describe('readme command', function() {
48+
describe('readme command', function () {
4949
const fixtures = path.join(__dirname, 'fixture/readme');
5050
const sourceFile = path.join(fixtures, 'index.js');
5151
let d;
@@ -63,7 +63,7 @@ describe('readme command', function() {
6363

6464
// run tests after setting up temp dir
6565

66-
test('--diff-only: changes needed', async function() {
66+
test('--diff-only: changes needed', async function () {
6767
const before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8');
6868
try {
6969
await documentation(['readme index.js --diff-only -s API'], {
@@ -77,13 +77,13 @@ describe('readme command', function() {
7777
}
7878
});
7979

80-
test('updates README.md', async function() {
80+
test('updates README.md', async function () {
8181
await documentation(['readme index.js -s API'], { cwd: d });
8282
const outputPath = path.join(d, 'README.md');
8383
expect(fs.readFileSync(outputPath, 'utf-8')).toMatchSnapshot();
8484
});
8585

86-
test('--readme-file', async function() {
86+
test('--readme-file', async function () {
8787
fs.copySync(
8888
path.join(fixtures, 'README.input.md'),
8989
path.join(d, 'other.md')
@@ -95,7 +95,7 @@ describe('readme command', function() {
9595
expect(actual).toMatchSnapshot();
9696
});
9797

98-
test('--diff-only: changes NOT needed', function() {
98+
test('--diff-only: changes NOT needed', function () {
9999
fs.copySync(
100100
path.join(fixtures, 'README.output.md'),
101101
path.join(d, 'uptodate.md')
@@ -108,7 +108,7 @@ describe('readme command', function() {
108108
});
109109
});
110110

111-
test('-s: not found', async function() {
111+
test('-s: not found', async function () {
112112
fs.copySync(
113113
path.join(fixtures, 'README.output.md'),
114114
path.join(d, 'uptodate.md')
@@ -123,7 +123,7 @@ describe('readme command', function() {
123123
}
124124
});
125125

126-
test('requires -s option', async function() {
126+
test('requires -s option', async function () {
127127
try {
128128
await documentation(['readme index.js'], { cwd: d });
129129
} catch (err) {
@@ -134,7 +134,7 @@ describe('readme command', function() {
134134
});
135135

136136
const badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input');
137-
test('errors on invalid syntax', async function() {
137+
test('errors on invalid syntax', async function () {
138138
try {
139139
await documentation(
140140
['readme ' + badFixturePath + ' -s API --parseExtension input'],

‎__tests__/bin-watch-serve.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ function documentation(args, options) {
2020
}
2121

2222
function normalize(result) {
23-
result.forEach(function(item) {
23+
result.forEach(function (item) {
2424
item.context.file = '[path]';
2525
});
2626
return result;
2727
}
2828

2929
const timeout = 20000;
3030

31-
test.skip('harness', function() {
31+
test.skip('harness', function () {
3232
const docProcess = documentation(['serve', 'fixture/simple.input.js']);
3333
expect(docProcess).toBeTruthy();
3434
docProcess.kill();
3535
});
3636

3737
test.skip(
3838
'provides index.html',
39-
function() {
39+
function () {
4040
const docProcess = documentation(['serve', 'fixture/simple.input.js']);
41-
return pEvent(docProcess.stdout, 'data').then(function(data) {
41+
return pEvent(docProcess.stdout, 'data').then(function (data) {
4242
const portNumber = data
4343
.toString()
4444
.match(/documentation.js serving on port (\d+)/);
4545
expect(portNumber).toBeTruthy();
46-
return get(`http://localhost:${portNumber[1]}/`).then(function(text) {
46+
return get(`http://localhost:${portNumber[1]}/`).then(function (text) {
4747
expect(text.match(/<html>/)).toBeTruthy();
4848
docProcess.kill();
4949
});
@@ -54,18 +54,18 @@ test.skip(
5454

5555
test.skip(
5656
'accepts port argument',
57-
function() {
57+
function () {
5858
const docProcess = documentation([
5959
'serve',
6060
'fixture/simple.input.js',
6161
'--port=4004'
6262
]);
63-
return pEvent(docProcess.stdout, 'data').then(function(data) {
63+
return pEvent(docProcess.stdout, 'data').then(function (data) {
6464
const portNumber = data
6565
.toString()
6666
.match(/documentation.js serving on port 4004/);
6767
expect(portNumber).toBeTruthy();
68-
return get(`http://localhost:4004/`).then(function(text) {
68+
return get(`http://localhost:4004/`).then(function (text) {
6969
expect(text.match(/<html>/)).toBeTruthy();
7070
docProcess.kill();
7171
});
@@ -76,20 +76,20 @@ test.skip(
7676

7777
test.skip(
7878
'--watch',
79-
function(done) {
79+
function (done) {
8080
const tmpFile = path.join(os.tmpdir(), '/simple.js');
8181
fs.writeFileSync(tmpFile, '/** a function */function apples() {}');
8282
const docProcess = documentation(['serve', tmpFile, '--watch']);
83-
pEvent(docProcess.stdout, 'data').then(function(data) {
83+
pEvent(docProcess.stdout, 'data').then(function (data) {
8484
const portNumber = data
8585
.toString()
8686
.match(/documentation.js serving on port (\d+)/);
8787
expect(portNumber).toBeTruthy();
88-
return get(`http://localhost:${portNumber[1]}/`).then(function(text) {
88+
return get(`http://localhost:${portNumber[1]}/`).then(function (text) {
8989
expect(text.match(/apples/)).toBeTruthy();
9090
fs.writeFileSync(tmpFile, '/** a function */function bananas() {}');
9191
function doGet() {
92-
get(`http://localhost:${portNumber[1]}/`).then(function(text) {
92+
get(`http://localhost:${portNumber[1]}/`).then(function (text) {
9393
if (text.match(/bananas/)) {
9494
docProcess.kill();
9595
done();
@@ -107,23 +107,23 @@ test.skip(
107107

108108
test.skip(
109109
'--watch',
110-
function(done) {
110+
function (done) {
111111
const tmpDir = os.tmpdir();
112112
const a = path.join(tmpDir, '/simple.js');
113113
const b = path.join(tmpDir, '/required.js');
114114
fs.writeFileSync(a, 'require("./required")');
115115
fs.writeFileSync(b, '/** soup */function soup() {}');
116116
const docProcess = documentation(['serve', a, '--watch']);
117-
docProcess.stdout.once('data', function(data) {
117+
docProcess.stdout.once('data', function (data) {
118118
const portNumber = data
119119
.toString()
120120
.match(/documentation.js serving on port (\d+)/);
121121
expect(portNumber).toBeTruthy();
122-
get(`http://localhost:${portNumber[1]}/`).then(function(text) {
122+
get(`http://localhost:${portNumber[1]}/`).then(function (text) {
123123
expect(text.match(/soup/)).toBeTruthy();
124124
fs.writeFileSync(b, '/** nuts */function nuts() {}');
125125
function doGet() {
126-
get(`http://localhost:${portNumber[1]}/`).then(function(text) {
126+
get(`http://localhost:${portNumber[1]}/`).then(function (text) {
127127
if (text.match(/nuts/)) {
128128
docProcess.kill();
129129
done();
@@ -141,17 +141,17 @@ test.skip(
141141

142142
test.skip(
143143
'error page',
144-
function() {
144+
function () {
145145
const tmpDir = os.tmpdir();
146146
const a = path.join(tmpDir, '/simple.js');
147147
fs.writeFileSync(a, '**');
148148
const docProcess = documentation(['serve', a, '--watch']);
149-
return pEvent(docProcess.stdout, 'data').then(function(data) {
149+
return pEvent(docProcess.stdout, 'data').then(function (data) {
150150
const portNumber = data
151151
.toString()
152152
.match(/documentation.js serving on port (\d+)/);
153153
expect(portNumber).toBeTruthy();
154-
return get(`http://localhost:${portNumber[1]}/`).then(function(text) {
154+
return get(`http://localhost:${portNumber[1]}/`).then(function (text) {
155155
expect(text.match(/Unexpected token/)).toBeTruthy();
156156
docProcess.kill();
157157
});

0 commit comments

Comments
 (0)
Please sign in to comment.