Download tasks/format-code-task-000029/tests/test.patch from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 2.29 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000029/tests/test.patch
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000029/tests/test.patch
-
curl -L -o test.patch https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000029/tests/test.patch
2.29 kB
| diff --git a/test/model.test.js b/test/model.test.js | |
| index c2e3f68c1e8..cca70e32fd8 100644 | |
| --- a/test/model.test.js | |
| +++ b/test/model.test.js | |
| describe('Model', function() { | |
| assert.equal(called, 1); | |
| }); | |
| + it('custom statics that overwrite model functions dont get hooks by default', async function() { | |
| + | |
| + const schema = new Schema({ name: String }); | |
| + | |
| + schema.statics.insertMany = function(docs) { | |
| + return model.insertMany.apply(this, [docs]); | |
| + }; | |
| + | |
| + let called = 0; | |
| + schema.pre('insertMany', function(next) { | |
| + ++called; | |
| + next(); | |
| + }); | |
| + const Model = db.model('Test', schema); | |
| + | |
| + const res = await Model.insertMany([ | |
| + { name: 'foo' }, | |
| + { name: 'boo' } | |
| + ]); | |
| + | |
| + assert.ok(res[0].name); | |
| + assert.ok(res[1].name); | |
| + assert.equal(called, 1); | |
| + }); | |
| + | |
| + it('custom statics that overwrite document functions dont get hooks by default', async function() { | |
| + | |
| + const schema = new Schema({ name: String }); | |
| + | |
| + schema.statics.save = function() { | |
| + return 'foo'; | |
| + }; | |
| + | |
| + let called = 0; | |
| + schema.pre('save', function(next) { | |
| + ++called; | |
| + next(); | |
| + }); | |
| + | |
| + const Model = db.model('Test', schema); | |
| + | |
| + const doc = await Model.save(); | |
| + | |
| + assert.ok(doc); | |
| + assert.equal(doc, 'foo'); | |
| + assert.equal(called, 0); | |
| + }); | |
| + | |
| it('error handling middleware passes saved doc (gh-7832)', async function() { | |
| const schema = new Schema({ _id: Number }); | |
| diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 | |
| new file mode 100644 | |
| --- /dev/null | |
| +++ b/mimo_build_env.tar.gz.b64 | |
| +H4sIAAAAAAAAA+3RUYrCMBSF4Ty7irsBY9KayXKkNgE7mGawqbj8afsyIji+KMPg/72cC7mQC0fv | |
| +x+4YdrE/b9SrmIl3bsnJbS6zdZWtjNk6XyljrfNeiXvZRVfGoTQnEXXKufy29+j9n9I//Zc4lF2b | |
| +U2r6oIfD8/541L+97r/2U//bD1MrMc874b43778NshS/j2HVf10k5fbQyHodL12ZonQp5rFIPfck | |
| +8+Im5RCPeh7157D66/sBAAAAAAAAAAAAAACAd/YNrbE5AwAoAAA= | |
| diff --git a/mimo_test_command.sh b/mimo_test_command.sh | |
| new file mode 100755 | |
| --- /dev/null | |
| +++ b/mimo_test_command.sh | |
| +#!/usr/bin/env bash | |
| + | |
| +set -uo pipefail | |
| +cd /testbed || exit 1 | |
| +base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 | |
| +exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' | |