-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(importDataSources): get error result of error in URL fetch
- Loading branch information
Showing
8 changed files
with
236 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { describe, it } from 'vitest'; | ||
import { expect } from 'chai'; | ||
import { DataSource } from '../dataSource'; | ||
import { importDataSources } from '../importDataSources'; | ||
|
||
describe('importDataSources', () => { | ||
it('should return error if illegal URI', async () => { | ||
const input: DataSource = { | ||
uriSrc: { | ||
uri: '// asdf asdf', | ||
name: 'image.jpg', | ||
}, | ||
}; | ||
const output = await importDataSources([input]); | ||
|
||
const firstResult = output[0]; | ||
expect(firstResult.ok).to.equals(false); | ||
if (!firstResult.ok) { | ||
expect(firstResult.errors.length).to.greaterThan(0); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.