Skip to content

Commit

Permalink
Reorganize Unit Test Files (#29)
Browse files Browse the repository at this point in the history
* re-structure tests directory

* update npmignore with new tests directory
  • Loading branch information
mike-weiner authored Jan 13, 2024
1 parent 3553a8a commit d0533c4
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jest.config.js
.jest/
coverage/
node_modules/
**/__tests__
tests/

# Ignore Github Repo Configuration
.github/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.unstable_mockModule('ora', () => ({
})
}));

const { default: config } = await import('../config.js');
const { default: config } = await import('../../commands/config.js');

describe('wlbot config', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.unstable_mockModule('../../../lib/utils.js', () => {
};
});

const { default: catalog } = await import('../catalog.js');
const { default: catalog } = await import('../../../commands/metadata/catalog.js');

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });
const dirSpy = jest.spyOn(console, "dir").mockImplementation(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.unstable_mockModule('../../../lib/utils.js', () => {
};
});

const { default: mine } = await import('../mine.js');
const { default: mine } = await import('../../../commands/metadata/mine.js');

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });
const dirSpy = jest.spyOn(console, "dir").mockImplementation(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.unstable_mockModule('../../../lib/utils.js', () => {
};
});

const { default: stations } = await import('../stations.js');
const { default: stations } = await import('../../../commands/metadata/stations.js');

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });
const dirSpy = jest.spyOn(console, "dir").mockImplementation(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.unstable_mockModule('axios', () => ({

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });

const { default: status } = await import('../status.js');
const { default: status } = await import('../../commands/status.js');

describe('wlbot config', () => {
const mockSuccessfulApiCall = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.unstable_mockModule('../../../lib/utils.js', () => {
};
});

const { default: current } = await import('../current.js');
const { default: current } = await import('../../../commands/weather/current.js');

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });
const dirSpy = jest.spyOn(console, "dir").mockImplementation(() => { });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.unstable_mockModule('../../../lib/utils.js', () => {
};
});

const { default: historic } = await import('../historic.js');
const { default: historic } = await import('../../../commands/weather/historic.js');

const logSpy = jest.spyOn(console, "log").mockImplementation(() => { });
const dirSpy = jest.spyOn(console, "dir").mockImplementation(() => { });
Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/utils.test.js → tests/lib/utils.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { buildWeatherLinkApiUrl, checkForRequired, dateRangeIsValid } from '../utils.js';
import { buildWeatherLinkApiUrl, checkForRequired, dateRangeIsValid } from '../../lib/utils.js';

describe('buildWeatherLinkApiUrl(...)', () => {
describe('Correctly Builds WeatherLink API URL', () => {
Expand Down

0 comments on commit d0533c4

Please sign in to comment.