Skip to content
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

Updating tests for Allergies #2568

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

jagdish-15
Copy link
Contributor

Pull Request

This PR syncs tests.toml with the problem-specifications repository and incorporates the new tests into the test file. These updates follow the approval in PR #2567.

npx cross-env ASSIGNMENT=practice/allergies babel-node scripts/test
PS C:\Programming\Exercism\javascript> npx cross-env ASSIGNMENT=practice/allergies babel-node scripts/test

Running tests for practice/allergies...
PASS tmp_exercises/practice/allergies/allergies.spec.js
  Allergies
    testing for eggs allergy
      √ not allergic to anything (3 ms)
      √ allergic only to eggs (1 ms)
      √ allergic to eggs and something else
      √ allergic to something, but not eggs
      √ allergic to everything
    testing for peanuts allergy
      √ not allergic to anything
      √ allergic only to peanuts
      √ allergic to peanuts and something else
      √ allergic to something, but not peanuts
      √ allergic to everything (1 ms)
    testing for shellfish allergy
      √ not allergic to anything
      √ allergic only to shellfish (4 ms)
      √ allergic to shellfish and something else
      √ allergic to something, but not shellfish
      √ allergic to everything
    testing for strawberries allergy
      √ not allergic to anything
      √ allergic only to strawberries
      √ allergic to strawberries and something else
      √ allergic to something, but not strawberries
      √ allergic to everything (1 ms)
    testing for tomatoes allergy
      √ not allergic to anything
      √ allergic only to tomatoes
      √ allergic to tomatoes and something else
      √ allergic to something, but not tomatoes
      √ allergic to everything
    testing for chocolate allergy
      √ not allergic to anything
      √ allergic only to chocolate
      √ allergic to chocolate and something else
      √ allergic to something, but not chocolate (1 ms)
      √ allergic to everything
    testing for pollen allergy
      √ not allergic to anything
      √ allergic only to pollen
      √ allergic to pollen and something else
      √ allergic to something, but not pollen (1 ms)
      √ allergic to everything
    testing for cats allergy
      √ not allergic to anything
      √ allergic only to cats
      √ allergic to cats and something else
      √ allergic to something, but not cats
      √ allergic to everything
    list when:
      √ no allergies (1 ms)
      √ just eggs
      √ just peanuts
      √ just strawberries
      √ eggs and peanuts
      √ more than eggs but not peanuts
      √ lots of stuff
      √ everything
      √ no allergen score parts
      √ no allergen score parts without highest valid score

Test Suites: 1 passed, 1 total
Tests:       50 passed, 50 total
Snapshots:   0 total
Time:        0.82 s
Ran all test suites matching /tmp_exercises/i.

Copy link
Contributor

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@Cool-Katt
Copy link
Contributor

@jagdish-15 seems like you missed formatting. The CI is unhappy.

@jagdish-15
Copy link
Contributor Author

npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix
PS C:\Programming\Exercism\javascript> npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix

C:\Programming\Exercism\javascript\exercises\concept\fruit-picker\.meta\exemplar.js
  5:24  error  Unable to resolve path to module './notifier'  import/no-unresolved
  6:23  error  Unable to resolve path to module './grocer'    import/no-unresolved

✖ 2 problems (2 errors, 0 warnings)

Upon running the linting command npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix provided in the repository’s README, I discovered incorrect paths in the exemplar.js file for this exercise. I’ve corrected the paths, but the CI still doesn’t seem to be happy, and I’m unable to get any details using the command. Could you help me with how I can check the linting for this track?

@Cool-Katt
Copy link
Contributor

Upon running the linting command npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix provided in the repository’s README, I discovered incorrect paths in the exemplar.js file for this exercise. I’ve corrected the paths, but the CI still doesn’t seem to be happy, and I’m unable to get any details using the command. Could you help me with how I can check the linting for this track?

Sorry, I didn't have much time to look at things but you seem to have figured it out.
For future reference, check the CONTRIBUTING.md guide. We have scripts for automatic formatting and linting so it's easiest to start there.

@jagdish-15
Copy link
Contributor Author

I was unable to pinpoint the issue with the npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix command. However, I realized that the problem was likely caused by me removing the trailing comma. After fixing that and reverting the path changes, I kept the PR focused on the subject at hand.

I plan to raise a separate PR specifically for the path changes in the fruit-picker exercise.

Thank you so much for the references! Now that I'm familiar with all the linting and formatting tools, I can work on the next exercises more efficiently.

@SleeplessByte
Copy link
Member

The problem is that npx eslint exercises/**/*.spec.js exercises/**/.meta/*.js --fix probably does NOT use our configuration correctly. The paths in the examplar file or not incorrect and eslint should be configured to ignore that but 🤷🏽

That said, to fix formatting, running format on the PR is always possible. To do that post a message to the PR with:

/format

Copy link
Contributor

github-actions bot commented Jan 2, 2025

The "Format code" action has started running.

Copy link
Contributor

github-actions bot commented Jan 2, 2025

The "Format code" action has finished running.

Copy link
Contributor

github-actions bot commented Jan 2, 2025

For security reasons, /format does not trigger CI builds when the PR has been submitted from a fork. If checks were not passing due to code format, trigger a build to make the required checks pass, through one of the following ways:

  • Push an empty commit to this branch: git commit --allow-empty -m "Trigger builds".
  • Close and reopen the PR.
  • Push a regular commit to this branch.

@SleeplessByte SleeplessByte reopened this Jan 2, 2025
@SleeplessByte SleeplessByte merged commit d0324d5 into exercism:main Jan 2, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants