-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test suite exercise difference of squares broken? #672
Comments
Hi there @marge2312, First check if your test suite looks like the code block below. If it doesn't, your test file might be out of date. This can happen if per chance you've downloaded it a while ago (maybe by accident) and we have since updated the test suite. In this case, browse to the solution page (exercism.io/tracks/ -> javascript -> difference of squares) and press the update exercism button. Download the exercise again. import { Squares } from './difference-of-squares';
describe('difference-of-squares', () => {
const squares1 = new Squares(1);
const squares5 = new Squares(5);
const squares100 = new Squares(100);
describe('Square the sum of the numbers up to the given number', () => {
xtest('square of sum 1', () => {
expect(squares1.squareOfSum).toBe(1);
});
xtest('square of sum 5', () => {
expect(squares5.squareOfSum).toBe(225);
});
xtest('square of sum 100', () => {
expect(squares100.squareOfSum).toBe(25502500);
});
});
describe('Sum the squares of the numbers up to the given number', () => {
xtest('sum of squares 1', () => {
expect(squares1.sumOfSquares).toBe(1);
});
xtest('sum of squares 5', () => {
expect(squares5.sumOfSquares).toBe(55);
});
xtest('sum of squares 100', () => {
expect(squares100.sumOfSquares).toBe(338350);
});
});
describe('Subtract sum of squares from square of sums', () => {
xtest('difference of squares 1', () => {
expect(squares1.difference).toBe(0);
});
xtest('difference of squares 5', () => {
expect(squares5.difference).toBe(170);
});
xtest('difference of squares 100', () => {
expect(squares100.difference).toBe(25164150);
});
});
}); If everything looks right, there is an outstanding bug with Jest that sometimes reports any error outside of the test suite as "describe should not return a value". There was another bug that was recently merged but not yet released. The expected error looks like this:
This error can be fixed by creating the file
In this case, the file is lacking an + export class Squares {
+
+ } It should now "run" correctly. |
thanks so much! 👍 |
Hello diligent programmers,
yesterday i downloaded the exercise "difference-of-squares" in javascript track.
i made 'npm install', created a file called 'difference-of-squares.js' and tried to run the test-suite with 'npm test'.
Unfortunately i encountered the following error:
anybody any ideas? i'm totally stuck... :(
best regards,
Marge
The text was updated successfully, but these errors were encountered: