-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: all unit tests are using Jest
- Loading branch information
Showing
15 changed files
with
66 additions
and
102 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
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 @@ | ||
const join = require('path').join | ||
const exists = require('fs').existsSync | ||
const check = require('../check-bower-file') | ||
|
||
const testFolder = join(__dirname, 'bower-test-with-deps') | ||
const bowerFilename = join(testFolder, 'bower.json') | ||
|
||
describe('running as parent tests', () => { | ||
beforeEach(() => { | ||
process.chdir(testFolder) | ||
}) | ||
afterEach(() => { | ||
process.chdir(__dirname) | ||
}) | ||
|
||
it('check function', () => { | ||
expect(typeof check).toBe('function') | ||
expect(exists(bowerFilename)).toBe(true) | ||
}) | ||
|
||
it('test itself via check', () => { | ||
expect(check(testFolder, bowerFilename, true)).toBe(true) | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
const join = require('path').join | ||
const exists = require('fs').existsSync | ||
const check = require('../check-bower-file') | ||
|
||
const testFolder = join(__dirname, 'bower-test') | ||
const bowerFilename = join(testFolder, 'bower.json') | ||
|
||
describe('running as parent tests', () => { | ||
beforeEach(() => { | ||
process.chdir(testFolder) | ||
}) | ||
afterEach(() => { | ||
process.chdir(__dirname) | ||
}) | ||
|
||
it('check function', () => { | ||
expect(typeof check).toBe('function') | ||
expect(exists(bowerFilename)).toBe(true) | ||
}) | ||
|
||
it('detects that dependencies are not installed', () => { | ||
expect(check(testFolder, bowerFilename, true)).toBe(false) | ||
}) | ||
}) |
File renamed without changes.
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,17 @@ | ||
const isSupported = require('../is-supported-version-format') | ||
|
||
describe('is supported version format', () => { | ||
it('regular versions', () => { | ||
expect(isSupported('0.2.0')).toBe(true) | ||
expect(isSupported('^0.2.0')).toBe(true) | ||
expect(isSupported('~0.2.0')).toBe(true) | ||
}) | ||
|
||
it('unsupported urls', () => { | ||
expect(isSupported('http://somewhere/repo')).toBe(false) | ||
expect(isSupported('git@github.com:bahmutov/angular-minicolors.git')).toBe(false) | ||
expect(isSupported('git://gh.com/foo/bar#30030')).toBe(false) | ||
expect(isSupported('github:jstrace/bars')).toBe(false) | ||
expect(isSupported('file:./dummy')).toBe(false) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/test/bower-test-with-deps/bower_components/lodash/.bower.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.