From 4d81140ea53640c93a24c2c1961e785120ec83ef Mon Sep 17 00:00:00 2001 From: Tian Na Date: Wed, 3 Jan 2024 10:27:47 +0800 Subject: [PATCH] update README and test for get USS file in ASCII_NO_TRAILING_BLANKS mode Signed-off-by: Tian Na --- README.md | 2 +- src/__test__/downloadFile.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53d8933..02bb36f 100644 --- a/README.md +++ b/README.md @@ -400,7 +400,7 @@ await connection.uploadFile(input, '/u/username/hosts'); ##### Parameter * filePath - _string_ - USS file path name. -* transferMode - _TransferMode_ - `TransferMode.ASCII`, `TransferMode.BINARY`. When downloading a text dataset, transferMode should be either `TransferMode.ASCII` so that z/OS FTP service converts `EBCDIC` characters to `ASCII`. +* transferMode - _TransferMode_ - `TransferMode.ASCII`, `TransferMode.BINARY` and `TransferMode.ASCII_NO_TRAILING_BLANKS`. The `TransferMode.ASCII` and `TransferMode.ASCII_NO_TRAILING_BLANKS` asks z/OS FTP service to convert `EBCDIC` characters to `ASCII`. The `TransferMode.ASCII_NO_TRAILING_BLANKS` asks z/OS FTP service to remove trailing blanks. * stream - _boolean_ - `true` if you want to obtain a [ReadableStream](https://nodejs.org/api/stream.html#stream_readable_streams) of the file content, or `false` to read a full file into memory (in Buffer). The buffer accepts up to 4MB data. For large file, use `stream=true` instead. ##### Return diff --git a/src/__test__/downloadFile.test.ts b/src/__test__/downloadFile.test.ts index 81ed59f..bff45a8 100644 --- a/src/__test__/downloadFile.test.ts +++ b/src/__test__/downloadFile.test.ts @@ -56,8 +56,8 @@ describe('The method of downloadFile()', () => { expect(buffer.toString()).toBe(text); }); - it('can get USS file in ASCII_NO_TRAILING_BLANKS mode', async () => { - const text = 'Hello'; + it.only('can get USS file in ASCII_NO_TRAILING_BLANKS mode', async () => { + const text = 'Hello\r\n'; const buffer = await accessor.downloadFile(getUSSPath('nodeacc/hello_with_trailingblanks.txt'), TransferMode.ASCII_NO_TRAILING_BLANKS); expect(buffer.toString()).toBe(text);