feat: initial commit
This commit is contained in:
18
tests/installDependencies.test.js
Normal file
18
tests/installDependencies.test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// tests/index.test.js
|
||||
|
||||
const { installDependencies } = require('../index');
|
||||
const child_process = require('child_process');
|
||||
|
||||
jest.mock('child_process');
|
||||
|
||||
describe('installDependencies', () => {
|
||||
it('should install dependencies without errors', () => {
|
||||
const execSyncMock = jest.spyOn(child_process, 'execSync').mockImplementation(() => {});
|
||||
|
||||
installDependencies();
|
||||
|
||||
expect(execSyncMock).toHaveBeenCalledWith(expect.stringContaining('npm install'), expect.anything());
|
||||
|
||||
execSyncMock.mockRestore();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user