-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from ngwese/feature/file
file handling improvements
- Loading branch information
Showing
31 changed files
with
1,744 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Chrome", | ||
"type": "chrome", | ||
"request": "launch", | ||
"url": "http://localhost:3000", | ||
"webRoot": "${workspaceRoot}/app/src" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { siblingScriptResourceForName } from './api'; | ||
|
||
it('no sibling returns something', () => { | ||
let r = siblingScriptResourceForName('untitled.lua'); | ||
expect(r).toEqual('/api/v1/scripts/untitled.lua'); | ||
}) | ||
|
||
it('should escape filename', () => { | ||
let r = siblingScriptResourceForName('one two.lua'); | ||
expect(r).toEqual('/api/v1/scripts/one%20two.lua'); | ||
}) | ||
|
||
it('root sibling should match no sibling', () => { | ||
let r = siblingScriptResourceForName('untitled.lua'); | ||
let q = siblingScriptResourceForName('untitled.lua', '/api/v1/scripts/foo.lua'); | ||
expect(q).toEqual(r); | ||
}) | ||
|
||
it('non-root sibling works', () => { | ||
let r = siblingScriptResourceForName('foo.lua', '/api/v1/scripts/one/two/three.lua'); | ||
expect(r).toEqual('/api/v1/scripts/one/two/foo.lua'); | ||
}) | ||
|
||
// TODO: add tests for fileFromResource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export const UNTITLED_SCRIPT = 'UNTITLED_SCRIPT'; | ||
import { Set } from "immutable"; | ||
|
||
export const MATRON_COMPONENT = 'matron'; | ||
export const CRONE_COMPONENT = 'crone'; | ||
export const UNTITLED_SCRIPT = "UNTITLED_SCRIPT"; | ||
|
||
export const MATRON_COMPONENT = "matron"; | ||
export const CRONE_COMPONENT = "crone"; | ||
|
||
export const INVALID_NAME_CHARS = new Set(["/"]); |
Oops, something went wrong.