This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jest-config) Fallback to default Jest config if it's not overriden (
#42)
- Loading branch information
1 parent
636b1fe
commit 72b542a
Showing
7 changed files
with
99 additions
and
14 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
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
6 changes: 6 additions & 0 deletions
6
testResources/exampleProjectWithDefaultJestConfig/package.json
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,6 @@ | ||
{ | ||
"private": true, | ||
"name": "example-project", | ||
"version": "0.0.0", | ||
"description": "A testResource for jest-test-runner" | ||
} |
20 changes: 20 additions & 0 deletions
20
testResources/exampleProjectWithDefaultJestConfig/src/Add.js
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,20 @@ | ||
exports.add = function(num1, num2) { | ||
return num1 + num2; | ||
}; | ||
|
||
exports.addOne = function(number) { | ||
number++; | ||
return number; | ||
}; | ||
|
||
exports.negate = function(number) { | ||
return -number; | ||
}; | ||
|
||
exports.isNegativeNumber = function(number) { | ||
var isNegative = false; | ||
if(number < 0){ | ||
isNegative = true; | ||
} | ||
return isNegative; | ||
}; |
50 changes: 50 additions & 0 deletions
50
testResources/exampleProjectWithDefaultJestConfig/src/__tests__/AddSpec.js
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,50 @@ | ||
var add = require('../Add').add; | ||
var addOne = require('../Add').addOne; | ||
var isNegativeNumber = require('../Add').isNegativeNumber; | ||
var negate = require('../Add').negate; | ||
|
||
describe('Add', function() { | ||
it('should be able to add two numbers', function() { | ||
var num1 = 2; | ||
var num2 = 5; | ||
var expected = num1 + num2; | ||
|
||
var actual = add(num1, num2); | ||
|
||
expect(actual).toBe(expected); | ||
}); | ||
|
||
it('should be able to add one to a number', function() { | ||
var number = 2; | ||
var expected = 3; | ||
|
||
var actual = addOne(number); | ||
|
||
expect(actual).toBe(expected); | ||
}); | ||
|
||
it('should be able negate a number', function() { | ||
var number = 2; | ||
var expected = -2; | ||
|
||
var actual = negate(number); | ||
|
||
expect(actual).toBe(expected); | ||
}); | ||
|
||
it('should be able to recognize a negative number', function() { | ||
var number = -2; | ||
|
||
var isNegative = isNegativeNumber(number); | ||
|
||
expect(isNegative).toBe(true); | ||
}); | ||
|
||
it('should be able to recognize that 0 is not a negative number', function() { | ||
var number = 0; | ||
|
||
var isNegative = isNegativeNumber(number); | ||
|
||
expect(isNegative).toBe(false); | ||
}); | ||
}); |