test: replace jest-mock with sinon, drop expect#427
test: replace jest-mock with sinon, drop expect#427gjf7 wants to merge 1 commit intoneovim:masterfrom
Conversation
| const logfile = path.resolve(process.env.NVIM_NODE_LOG_FILE); | ||
| fs.writeFileSync(logfile, `${msg}\n`, { flag: 'a' }); | ||
| } | ||
| // const testFile = expect.getState().testPath?.replace(/.*[\\/]/, ''); |
There was a problem hiding this comment.
I have't find a way to get the current test filename outside of the mocha test file, maybe it's impossible ?
| expect( | ||
| await pluginObj.handleRequest('Global', 'function', ['Buffer']) | ||
| ).not.toEqual(undefined); | ||
| expect( |
There was a problem hiding this comment.
I found that pluginObj is not a array, so this test always success before?
There was a problem hiding this comment.
don't spend too much time on the "remote plugin" tests, because most of them will be irrelevant after #344
| 'process', | ||
| ]); | ||
|
|
||
| // expect( |
| assert.deepStrictEqual(invalidPaths, customPaths); | ||
| }); | ||
|
|
||
| it('searches in additional custom dirs', () => { |
There was a problem hiding this comment.
don't know why this test has started failing.
|
This looks like a lateral move in terms of dependency cost so maybe we should skip it. |
Indeed, could merge when we want to drop jest-mock(the work is almost done). |
Removed |
|
Yeah, but the line count increased and some of these look like regressions. E.g.: - expect(typeof plugin).toEqual('function');
+ assert(typeof plugin === 'function');
should be in order to continue to have ergonomic failure messages. also |
Follow up #333 .
Remove expect to reduce total number of dependencies, but I found that is hard to use jest-mock without expect, so let's just get rid of it.