Skip to content

Commit 07b7628

Browse files
committed
Format test TypeScript files for consistency
1 parent bca6ea2 commit 07b7628

File tree

4 files changed

+1281
-1281
lines changed

4 files changed

+1281
-1281
lines changed

0.10/test/index.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,58 @@ assert.notStrictEqual(2, "2", "uses === comparator");
2424
assert.throws(() => { throw "a hammer at your face"; }, "DODGED IT");
2525

2626
assert.doesNotThrow(() => {
27-
if (false) { throw "a hammer at your face"; }
27+
if (false) { throw "a hammer at your face"; }
2828
}, "What the...*crunch*");
2929

3030
////////////////////////////////////////////////////
3131
/// File system tests : http://nodejs.org/api/fs.html
3232
////////////////////////////////////////////////////
3333
fs.writeFile("thebible.txt",
34-
"Do unto others as you would have them do unto you.",
35-
assert.ifError);
34+
"Do unto others as you would have them do unto you.",
35+
assert.ifError);
3636

3737
fs.writeFile("Harry Potter",
38-
"\"You be wizzing, Harry,\" jived Dumbledore.",
39-
{
40-
encoding: "ascii"
41-
},
42-
assert.ifError);
38+
"\"You be wizzing, Harry,\" jived Dumbledore.",
39+
{
40+
encoding: "ascii"
41+
},
42+
assert.ifError);
4343

4444
var content: string,
45-
buffer: Buffer;
45+
buffer: Buffer;
4646

4747
content = fs.readFileSync('testfile', 'utf8');
48-
content = fs.readFileSync('testfile', {encoding : 'utf8'});
48+
content = fs.readFileSync('testfile', { encoding: 'utf8' });
4949
buffer = fs.readFileSync('testfile');
50-
buffer = fs.readFileSync('testfile', {flag : 'r'});
50+
buffer = fs.readFileSync('testfile', { flag: 'r' });
5151
fs.readFile('testfile', 'utf8', (err, data) => content = data);
52-
fs.readFile('testfile', {encoding : 'utf8'}, (err, data) => content = data);
52+
fs.readFile('testfile', { encoding: 'utf8' }, (err, data) => content = data);
5353
fs.readFile('testfile', (err, data) => buffer = data);
54-
fs.readFile('testfile', {flag : 'r'}, (err, data) => buffer = data);
54+
fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data);
5555

5656
class Networker extends events.EventEmitter {
57-
constructor() {
58-
super();
57+
constructor() {
58+
super();
5959

60-
this.emit("mingling");
61-
}
60+
this.emit("mingling");
61+
}
6262
}
6363

6464
var errno: number;
6565
fs.readFile('testfile', (err, data) => {
66-
if (err && err.errno) {
67-
errno = err.errno;
68-
}
66+
if (err && err.errno) {
67+
errno = err.errno;
68+
}
6969
});
7070

7171
url.format(url.parse('http://www.example.com/xyz'));
7272

7373
// https://google.com/search?q=you're%20a%20lizard%2C%20gary
7474
url.format({
75-
protocol: 'https',
76-
host: "google.com",
77-
pathname: 'search',
78-
query: { q: "you're a lizard, gary" }
75+
protocol: 'https',
76+
host: "google.com",
77+
pathname: 'search',
78+
query: { q: "you're a lizard, gary" }
7979
});
8080

8181
// Old and new util.inspect APIs
@@ -88,10 +88,10 @@ util.inspect(["This is nice"], { colors: true, depth: 5, customInspect: false })
8888

8989
// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
9090
function stream_readable_pipe_test() {
91-
var r = fs.createReadStream('file.txt');
92-
var z = zlib.createGzip();
93-
var w = fs.createWriteStream('file.txt.gz');
94-
r.pipe(z).pipe(w);
91+
var r = fs.createReadStream('file.txt');
92+
var z = zlib.createGzip();
93+
var w = fs.createWriteStream('file.txt.gz');
94+
r.pipe(z).pipe(w);
9595
}
9696

9797
////////////////////////////////////////////////////
@@ -107,18 +107,18 @@ http.createServer().listen(0).close().address();
107107
net.createServer().listen(0).close().address();
108108

109109
var request = http.request('http://0.0.0.0');
110-
request.once('error', function () {});
110+
request.once('error', function () { });
111111
request.setNoDelay(true);
112112
request.abort();
113113

114114
////////////////////////////////////////////////////
115115
/// Http tests : http://nodejs.org/api/http.html
116116
////////////////////////////////////////////////////
117117
namespace http_tests {
118-
// Status codes
119-
var code = 100;
120-
var codeMessage = http.STATUS_CODES['400'];
121-
var codeMessage = http.STATUS_CODES[400];
118+
// Status codes
119+
var code = 100;
120+
var codeMessage = http.STATUS_CODES['400'];
121+
var codeMessage = http.STATUS_CODES[400];
122122
}
123123

124124
////////////////////////////////////////////////////
@@ -156,6 +156,6 @@ rl.setPrompt("$>");
156156
rl.prompt();
157157
rl.prompt(true);
158158

159-
rl.question("do you like typescript?", function(answer: string) {
159+
rl.question("do you like typescript?", function (answer: string) {
160160
rl.close();
161161
});

0 commit comments

Comments
 (0)