mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Rename isFile() to isFileSync()
This commit is contained in:
@@ -15,9 +15,9 @@ describe "install(commandPath, callback)", ->
|
||||
|
||||
it "symlinks the command and makes it executable", ->
|
||||
fsUtils.write(commandPath, 'test')
|
||||
expect(fsUtils.isFile(commandPath)).toBeTruthy()
|
||||
expect(fsUtils.isFileSync(commandPath)).toBeTruthy()
|
||||
expect(fsUtils.isExecutable(commandPath)).toBeFalsy()
|
||||
expect(fsUtils.isFile(destinationPath)).toBeFalsy()
|
||||
expect(fsUtils.isFileSync(destinationPath)).toBeFalsy()
|
||||
|
||||
installDone = false
|
||||
installError = null
|
||||
@@ -29,6 +29,6 @@ describe "install(commandPath, callback)", ->
|
||||
|
||||
runs ->
|
||||
expect(installError).toBeNull()
|
||||
expect(fsUtils.isFile(destinationPath)).toBeTruthy()
|
||||
expect(fsUtils.isFileSync(destinationPath)).toBeTruthy()
|
||||
expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath)
|
||||
expect(fsUtils.isExecutable(destinationPath)).toBeTruthy()
|
||||
|
||||
@@ -9,18 +9,18 @@ describe "fsUtils", ->
|
||||
it "does not through an exception when the path is a binary file", ->
|
||||
expect(-> fsUtils.read(require.resolve("fixtures/binary-file.png"))).not.toThrow()
|
||||
|
||||
describe ".isFile(path)", ->
|
||||
describe ".isFileSync(path)", ->
|
||||
fixturesDir = fsUtils.resolveOnLoadPath('fixtures')
|
||||
|
||||
it "returns true with a file path", ->
|
||||
expect(fsUtils.isFile(path.join(fixturesDir, 'sample.js'))).toBe true
|
||||
expect(fsUtils.isFileSync(path.join(fixturesDir, 'sample.js'))).toBe true
|
||||
|
||||
it "returns false with a directory path", ->
|
||||
expect(fsUtils.isFile(fixturesDir)).toBe false
|
||||
expect(fsUtils.isFileSync(fixturesDir)).toBe false
|
||||
|
||||
it "returns false with a non-existent path", ->
|
||||
expect(fsUtils.isFile(path.join(fixturesDir, 'non-existent'))).toBe false
|
||||
expect(fsUtils.isFile(null)).toBe false
|
||||
expect(fsUtils.isFileSync(path.join(fixturesDir, 'non-existent'))).toBe false
|
||||
expect(fsUtils.isFileSync(null)).toBe false
|
||||
|
||||
describe ".exists(path)", ->
|
||||
it "returns true when path exsits", ->
|
||||
|
||||
Reference in New Issue
Block a user