Skip to content

Commit

Permalink
Misc (#113)
Browse files Browse the repository at this point in the history
* Add unit test for 'embed.motoko.org' embed URL

* Fix regression in Vite project setup
  • Loading branch information
rvanasa committed Sep 27, 2023
1 parent a7f550e commit df23f0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/test/Backend.test.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let backend = await Backend();

let cases = [
("/services/oembed?format=xml&url=https%3A%2F%2Fembed.smartcontracts.org%2Fabcdef&maxheight=800&lines=5", "<?xml version=\221.0\22 encoding=\22utf-8\22 standalone=\22yes\22?><oembed><version>1.0</version><provider_name>Embed Motoko</provider_name><provider_url>https://embed.motoko.org</provider_url><type>rich</type><width>800</width><height>285</height><html>&lt;iframe src=&quot;https://embed.smartcontracts.org/abcdef&quot; width=&quot;800&quot; height=&quot;285&quot; style=&quot;border:0&quot; /&gt;</html></oembed>"),
("/services/oembed?format=xml&url=https%3A%2F%2Fembed.motoko.org%2Fabcdef&maxheight=800&lines=5", "<?xml version=\221.0\22 encoding=\22utf-8\22 standalone=\22yes\22?><oembed><version>1.0</version><provider_name>Embed Motoko</provider_name><provider_url>https://embed.motoko.org</provider_url><type>rich</type><width>800</width><height>285</height><html>&lt;iframe src=&quot;https://embed.motoko.org/abcdef&quot; width=&quot;800&quot; height=&quot;285&quot; style=&quot;border:0&quot; /&gt;</html></oembed>"),
];

for ((url, expected) in cases.vals()) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/index.tsx"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
5 changes: 2 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { imagetools } from 'vite-imagetools';
dotenv.config();

export default defineConfig({
root: 'src',
build: {
outDir: '../dist',
outDir: 'dist',
emptyOutDir: true,
},
optimizeDeps: {
Expand All @@ -36,7 +35,7 @@ export default defineConfig({
],
test: {
environment: 'jsdom',
setupFiles: './setupTests.ts',
setupFiles: 'src/setupTests.ts',
coverage: {
reporter: ['text', 'json', 'html'],
},
Expand Down

0 comments on commit df23f0f

Please sign in to comment.