Skip to content

Commit

Permalink
Added Uint8Array test with encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandercerutti committed Jan 20, 2025
1 parent 67c52c3 commit 57819f2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/res.send.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ describe('res', function(){
.expect(200, 'hey', done);
})

it('should accept Uint8Array', function(done){
var app = express();
app.use(function(req, res){
const encodedHey = new TextEncoder().encode("hey");
res.set("Content-Type", "text/plain").send(encodedHey);
})

request(app)
.get("/")
.expect("Content-Type", "text/plain; charset=utf-8")
.expect(200, "hey", done);
})

it('should not override ETag', function (done) {
var app = express()

Expand Down

0 comments on commit 57819f2

Please # to comment.