-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15cd61d
commit 07c5bde
Showing
21 changed files
with
339 additions
and
2,209 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,11 +1,11 @@ | ||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000 | ||
|
||
require('./callSpec') | ||
require('./executeSpec') | ||
require('./formatSpec') | ||
require('./imageHomeSpec') | ||
require('./testAssetsSpec') | ||
require('./util/cliSpec') | ||
require('./util/htmlSpec') | ||
require('./util/fileSpec') | ||
require('./util/imageSpec') | ||
import * as callSpec from './callSpec' | ||
import * as executeSpec from './executeSpec' | ||
import * as formatSpec from './formatSpec' | ||
import * as imageHomeSpec from './imageHomeSpec' | ||
import * as testAssetsSpec from './testAssetsSpec' | ||
import * as cliSpec from './util/cliSpec' | ||
import * as htmlSpec from './util/htmlSpec' | ||
import * as fileSpec from './util/fileSpec' | ||
import * as imageSpec from './util/imageSpec' |
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,41 +1,39 @@ | ||
import { arrayToCli, cliToArray } from '../../src'; | ||
import { arrayToCli, cliToArray } from '../../src' | ||
|
||
describe('util/cli', () => { | ||
|
||
describe('arrayToCli', ()=>{ | ||
describe('arrayToCli', () => { | ||
it('should support simple commands', () => { | ||
expect(arrayToCli(['convert', 'foo.png', '-sharpen', '10x8', 'bar.gif'])) | ||
.toBe('convert foo.png -sharpen 10x8 bar.gif') | ||
|
||
}) | ||
it('should escape parenthesis', () => { | ||
expect(arrayToCli(["convert", "foo.png", "(", "+clone", "-channel", "R", "-fx", "B", ")", "+swap", "-channel", "B", "-fx", "v.R", "bar.gif"])) | ||
it('should escape parenthesis', () => { | ||
expect(arrayToCli(['convert', 'foo.png', '(', '+clone', '-channel', 'R', '-fx', 'B', ')', '+swap', '-channel', 'B', '-fx', 'v.R', 'bar.gif'])) | ||
.toBe(`convert foo.png \\( +clone -channel R -fx B \\) +swap -channel B -fx v.R bar.gif`) | ||
}) | ||
it('should quote arguments with spaces', () => { | ||
expect(arrayToCli(["convert", "input foo.png", "(", "+clone", "-channel", "R", "-fx", "B", ")", "+swap", "-channel", "B", "-fx", "v.R", "output bar.gif"])) | ||
it('should quote arguments with spaces', () => { | ||
expect(arrayToCli(['convert', 'input foo.png', '(', '+clone', '-channel', 'R', '-fx', 'B', ')', '+swap', '-channel', 'B', '-fx', 'v.R', 'output bar.gif'])) | ||
.toBe(`convert 'input foo.png' \\( +clone -channel R -fx B \\) +swap -channel B -fx v.R 'output bar.gif'`) | ||
}) | ||
}) | ||
|
||
|
||
describe('cliToArray', ()=>{ | ||
describe('cliToArray', () => { | ||
|
||
it('should support simple commands', () => { | ||
expect(cliToArray(`convert foo.png -rotate 90 bar.gif`)) | ||
.toEqual(["convert", "foo.png", "-rotate", "90", "bar.gif"]) | ||
.toEqual(['convert', 'foo.png', '-rotate', '90', 'bar.gif']) | ||
}) | ||
|
||
it('should support commands with quoted arguments', () => { | ||
expect(cliToArray(`convert 'my picture.png' -rotate 90 'output image.png'`)) | ||
.toEqual(["convert", "my picture.png", "-rotate", "90", "output image.png"]) | ||
.toEqual(['convert', 'my picture.png', '-rotate', '90', 'output image.png']) | ||
}) | ||
|
||
it('should support escaped parenthesis', () => { | ||
expect(cliToArray(`convert foo.png \\( +clone -channel R -fx B \\) +swap -channel B -fx v.R bar.gif`)) | ||
.toEqual(["convert", "foo.png", "(", "+clone", "-channel", "R", "-fx", "B", ")", "+swap", "-channel", "B", "-fx", "v.R", "bar.gif"]) | ||
.toEqual(['convert', 'foo.png', '(', '+clone', '-channel', 'R', '-fx', 'B', ')', '+swap', '-channel', 'B', '-fx', 'v.R', 'bar.gif']) | ||
}) | ||
}) | ||
|
||
|
||
}) | ||
}) |
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
Oops, something went wrong.