mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-20 12:44:09 +00:00
Migrate from ESLint to Oxlint and Oxfmt
This commit is contained in:
@@ -54,7 +54,9 @@ describe('ServersExporter', () => {
|
||||
it('makes use of download link API', () => {
|
||||
const jsonToCsvMock = createJsonToCsvMock();
|
||||
const exporter = new ServersExporter(storageMock, windowMock, jsonToCsvMock);
|
||||
const { document: { createElement } } = windowMock;
|
||||
const {
|
||||
document: { createElement },
|
||||
} = windowMock;
|
||||
|
||||
exporter.exportServers();
|
||||
|
||||
|
||||
@@ -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