Implement function convertLineEndingsToNative in blob.ts (#2695)

based on https://w3c.github.io/FileAPI/#convert-line-endings-to-native
This commit is contained in:
Tomohito Nakayama 2019-08-01 23:04:39 +09:00 committed by Ryan Dahl
parent 3971dcfe10
commit deec1b9b97
2 changed files with 56 additions and 3 deletions

View file

@ -50,4 +50,13 @@ test(function blobShouldNotThrowError(): void {
assertEquals(hasThrown, false);
});
test(function nativeEndLine(): void {
const options: object = {
ending: "native"
};
let blob = new Blob(["Hello\nWorld"], options);
assertEquals(blob.size, Deno.build.os === "win" ? 12 : 11);
});
// TODO(qti3e) Test the stored data in a Blob after implementing FileReader API.