Skip to content

Commit f37f5b5

Browse files
authored
Merge pull request #282 from pascalre/remove-unused-readfile-7287668804241570251
🧹 Remove unused FileUtil.readFile method
2 parents 9f8b7f1 + 839605d commit f37f5b5

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

src/test/suite/util/file-util.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ suite("Test FileUtil - getFiles()", () => {
3333
})
3434
})
3535

36-
suite("Test FileUtil - readFile()", () => {
37-
const fileutil = new FileUtil()
38-
39-
test("when `file` is a path to an existing file should return the files content", () => {
40-
equal(fileutil.readFile("./src/test/suite/util/resources/readFile.txt"), "lorem impsum")
41-
})
42-
43-
test("when `file` is a path to a non existing file should throw", () => {
44-
throws(() => fileutil.readFile("nonexistent-path"), Error)
45-
})
46-
})
47-
4836
suite("Test FileUtil - sortFile()", () => {
4937
const fileutil = new FileUtil()
5038

src/util/file-util.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export class FileUtil {
2222
return files
2323
}
2424

25-
readFile(file: string) {
26-
return readFileSync(file, this.encoding).toString()
27-
}
28-
2925
sortFile(file: string) {
3026
const yamlutil = new YamlUtil()
3127
const text = readFileSync(file, this.encoding).toString()

0 commit comments

Comments
 (0)