(options)
| 919 | }); |
| 920 | |
| 921 | function createTestContext(options) { |
| 922 | const schema = new Schema({ name: String }); |
| 923 | |
| 924 | schema.pre('insertMany', function() { |
| 925 | throw options.preHookError; |
| 926 | }); |
| 927 | |
| 928 | if (options.postHook) { |
| 929 | schema.post('insertMany', options.postHook); |
| 930 | } |
| 931 | |
| 932 | if (options.errorPostHook) { |
| 933 | schema.post('insertMany', options.errorPostHook); |
| 934 | } |
| 935 | |
| 936 | const User = db.model('User', schema); |
| 937 | return { User }; |
| 938 | } |
| 939 | }); |
| 940 | }); |
no outgoing calls
no test coverage detected