Skip to content

Commit c2a8346

Browse files
authored
add some tests (#11)
1 parent 75e4f83 commit c2a8346

File tree

8 files changed

+51
-6
lines changed

8 files changed

+51
-6
lines changed

transforms/__testfixtures__/pluralized-methods/charset.input.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const charset = req.acceptsCharset('utf-8');
7-
res.json({ charset }, 200);
7+
res.json({ charset });
88
});
99

10+
app.get('/', function (request, response) {
11+
const charset = request.acceptsCharset('utf-8');
12+
response.json({ charset });
13+
});

transforms/__testfixtures__/pluralized-methods/charset.output.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const charset = req.acceptsCharsets('utf-8');
7-
res.json({ charset }, 200);
7+
res.json({ charset });
88
});
99

10+
app.get('/', function (request, response) {
11+
const charset = request.acceptsCharsets('utf-8');
12+
response.json({ charset });
13+
});

transforms/__testfixtures__/pluralized-methods/encoding.input.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const encoding = req.acceptsEncoding('gzip');
7-
res.json({ encoding }, 200);
7+
res.json({ encoding });
8+
});
9+
10+
app.get('/', function (request, response) {
11+
const encoding = request.acceptsEncoding('gzip');
12+
response.json({ encoding });
813
});

transforms/__testfixtures__/pluralized-methods/encoding.output.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const encoding = req.acceptsEncodings('gzip');
7-
res.json({ encoding }, 200);
7+
res.json({ encoding });
88
});
9+
10+
app.get('/', function (request, response) {
11+
const encoding = request.acceptsEncodings('gzip');
12+
response.json({ encoding });
13+
});

transforms/__testfixtures__/pluralized-methods/language.input.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const encoding = req.acceptsLanguage('gzip');
7-
res.json({ encoding }, 200);
7+
res.json({ encoding });
8+
});
9+
10+
app.get('/', function (request, response) {
11+
const encoding = request.acceptsLanguage('gzip');
12+
response.json({ encoding });
813
});
914

transforms/__testfixtures__/pluralized-methods/language.output.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const app = express()
44

55
app.get('/', (req, res) => {
66
const encoding = req.acceptsLanguages('gzip');
7-
res.json({ encoding }, 200);
7+
res.json({ encoding });
88
});
99

10+
app.get('/', function (request, response) {
11+
const encoding = request.acceptsLanguages('gzip');
12+
response.json({ encoding });
13+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import express from "express";
2+
import { redirect } from "somelibrary";
23

34
const app = express();
45

56
app.get("/", function (req, res) {
67
res.redirect("/other-page", 301);
78
});
9+
10+
app.get("/", function (req, response) {
11+
response.redirect("/other-page", 301);
12+
});
13+
14+
app.get("/", function (req, res) {
15+
redirect(301, "/other-page");
16+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import express from "express";
2+
import { redirect } from "somelibrary";
23

34
const app = express();
45

56
app.get("/", function (req, res) {
67
res.redirect(301, "/other-page");
78
});
9+
10+
app.get("/", function (req, response) {
11+
response.redirect(301, "/other-page");
12+
});
13+
14+
app.get("/", function (req, res) {
15+
redirect(301, "/other-page");
16+
});

0 commit comments

Comments
 (0)