(options)
| 944 | }); |
| 945 | |
| 946 | function createTestContext(options) { |
| 947 | const schema = new Schema({ name: String }); |
| 948 | |
| 949 | schema.pre('insertMany', function() { |
| 950 | throw options.preHookError; |
| 951 | }); |
| 952 | |
| 953 | if (options.postHook) { |
| 954 | schema.post('insertMany', options.postHook); |
| 955 | } |
| 956 | |
| 957 | if (options.errorPostHook) { |
| 958 | schema.post('insertMany', options.errorPostHook); |
| 959 | } |
| 960 | |
| 961 | const User = db.model('User', schema); |
| 962 | return { User }; |
| 963 | } |
| 964 | }); |
| 965 | }); |
no outgoing calls
no test coverage detected