Created
October 4, 2020 05:28
-
-
Save rahulmalhotra/25e7e777265f9f0aa90d532e5deecccd to your computer and use it in GitHub Desktop.
This code snippet is used in Testing JavaScript Code using Jasmine JavaScript Tutorial on SFDC Stop
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
describe('Testing Calculator...', function() { | |
// * Positive Test Cases | |
it('Testing Add Function Positive', function() { | |
expect(add(2, 2)).toBe(4); | |
}); | |
it('Testing Sub Function Positive', function() { | |
expect(sub(2, 2)).toBe(0); | |
}); | |
it('Testing Mul Function Positive', function() { | |
expect(mul(2, 2)).toBe(4); | |
}); | |
it('Testing Div Function Positive', function() { | |
expect(div(2, 2)).toBe(1); | |
}); | |
// * Negative Test Cases | |
it('Testing Add Function Negative', function() { | |
expect(add(2, 2)).not.toBe(0); | |
}); | |
it('Testing Sub Function Negative', function() { | |
expect(sub(2, 2)).not.toBe(4); | |
}); | |
it('Testing Mul Function Negative', function() { | |
expect(mul(2, 2)).not.toBe(1); | |
}); | |
it('Testing Div Function Negative', function() { | |
expect(div(2, 2)).not.toBe(4); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment