-
-
Notifications
You must be signed in to change notification settings - Fork 93
[WIP] Move to Mocha tests #320
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
base: master
Are you sure you want to change the base?
Conversation
…n meteor-collection-hooks
…dependency in tests-app
…ntext tests in publish.test.js due to v2.0.0 changes.
name: tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
meteorRelease: | ||
- '--release 3.0.4' | ||
- '--release 3.1' | ||
meteor: [ '3.3' ] | ||
# needs: [lintcode,lintstyle,lintdocs] # we could add prior jobs for linting, if desired | ||
steps: | ||
- name: Checkout code | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- name: Setup meteor | ||
uses: meteorengineer/setup-meteor@v2 | ||
with: | ||
node-version: '20.x' | ||
meteor-release: ${{ matrix.meteor }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
curl https://install.meteor.com | /bin/sh | ||
npm i -g @zodern/mtest | ||
- name: Run Tests | ||
run: | | ||
mtest --package ./ --once ${{ matrix.meteorRelease }} | ||
- name: cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: cd tests-app && meteor npm install && meteor npm run test |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the issue, we will add a permissions
block at the root of the workflow. This block will apply to all jobs in the workflow unless overridden by a job-specific permissions
block. Since the workflow only needs to read repository contents (e.g., for checking out code), we will set contents: read
as the minimal required permission.
-
Copy modified lines R5-R6
@@ -4,2 +4,4 @@ | ||
name: Test suite | ||
permissions: | ||
contents: read | ||
|
…` instead of `_super`. Introduce constants for async methods and MongoDB operators for better readability and maintainability.
… methods to prevent recursion.
…dicated helper functions for hook registration, options setup, direct methods, and method wrapping.
…ling replace and remove operations for individual hooks in collection methods.
…t, and limitations for find hooks.
… instead of current directory
Fix failing server side tests
Fix linting
Verify .find hooks workHistory & README were updated to properly reflect the current package status
Support both sync and async operations in all hooksAs I was working on the package I thought it'd be possible to support async operations in sync hooks but I then figured how hard it'd be to support such a thing as blocking sync execution based on a sync operation wouldn't be feasible and allowing async operations as fire-and-forget to not block things would be awkward. I know understand why @bhunjadi decided to drop sync support and now hooks are only triggered on async operations (ex:
findOneAsync
instead offindOne
)Async hook started // ← Hook fires immediately findOne returned: {_id: 1, name: 'John'} // ← findOne completes WITHOUT waiting Async hook finished // ← Hook completes later (200ms later)
Fix CI tests
Utilize https://packosphere.com/lai/collection-extensions until Integrate lai:collection-extensions into core meteor/meteor#13830 gets merged
Review files one last time compared to their older versions to ensure they still retain the same structure
Try it out in my top secret project @DanielDornhardt
Once it's ready, ping @vparpoil for one last test
Profit??
Post release