mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-23 06:04:15 +00:00
Migrate from ESLint to Oxlint and Oxfmt
This commit is contained in:
@@ -11,9 +11,7 @@ describe('ServersImporter', () => {
|
||||
|
||||
describe('importServersFromFile', () => {
|
||||
it.each([[null], [undefined]])('rejects with error if no file was provided', async (file) => {
|
||||
await expect(importer.importServersFromFile(file)).rejects.toEqual(
|
||||
new Error('No file provided'),
|
||||
);
|
||||
await expect(importer.importServersFromFile(file)).rejects.toEqual(new Error('No file provided'));
|
||||
});
|
||||
|
||||
it('rejects with error if parsing the file fails', async () => {
|
||||
@@ -52,13 +50,13 @@ describe('ServersImporter', () => {
|
||||
],
|
||||
expectedError: 'Server is missing required "url", "apiKey" and/or "name" properties',
|
||||
},
|
||||
])('rejects with error if provided file does not parse to valid list of servers', async ({
|
||||
parsedObject,
|
||||
expectedError,
|
||||
}) => {
|
||||
csvjsonMock.mockResolvedValue(parsedObject);
|
||||
await expect(importer.importServersFromFile(fileMock())).rejects.toEqual(new Error(expectedError));
|
||||
});
|
||||
])(
|
||||
'rejects with error if provided file does not parse to valid list of servers',
|
||||
async ({ parsedObject, expectedError }) => {
|
||||
csvjsonMock.mockResolvedValue(parsedObject);
|
||||
await expect(importer.importServersFromFile(fileMock())).rejects.toEqual(new Error(expectedError));
|
||||
},
|
||||
);
|
||||
|
||||
it('reads file when a CSV containing valid servers is provided', async () => {
|
||||
const expectedServers: Required<ServerData>[] = [
|
||||
|
||||
Reference in New Issue
Block a user