-
Notifications
You must be signed in to change notification settings - Fork 2
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
f9dbcdd
commit 502b4f4
Showing
10 changed files
with
57 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
13 changes: 13 additions & 0 deletions
13
packages/@lazy-node/semver-ampersand/test/options.cache.spec.ts
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,13 @@ | ||
import { Range } from '../lib/Range'; | ||
|
||
test(`check cache is work`, () => | ||
{ | ||
let range = '>01.02.03'; | ||
|
||
expect(new Range(range, true)).toMatchSnapshot(); | ||
//expect(actual).toBeInstanceOf(Date); | ||
expect(() => new Range(range)).toThrowErrorMatchingSnapshot(); | ||
|
||
}); | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
packages/@lazy-node/semver-ampersand/test/ranges/valid.test.ts
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,11 @@ | ||
import rangeParse from '../fixtures/range-parse'; | ||
import validRange from '../../lib/validRange'; | ||
import { inspect } from 'util'; | ||
import { _replaceDoubleVerticalBar } from '../util'; | ||
|
||
describe('valid range test', () => { | ||
// validRange(range) -> result | ||
// translate ranges into their canonical form | ||
rangeParse.forEach(([pre, wanted, options]) => | ||
test(`validRange(${pre}, ${inspect(options)}) === ${wanted = _replaceDoubleVerticalBar(wanted)}`, () => expect(validRange(pre, options)).toBe(wanted))) | ||
}) |
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,11 @@ | ||
import { reDoubleVerticalBar, separatorDoubleVerticalBar } from '../lib/const'; | ||
|
||
export function _replaceDoubleVerticalBar(expected: string) | ||
{ | ||
if (expected != null) | ||
{ | ||
return expected.replace(reDoubleVerticalBar, separatorDoubleVerticalBar) | ||
} | ||
|
||
return expected | ||
} |