-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to use new import maps.
- Loading branch information
1 parent
314136e
commit 8d83c2c
Showing
2 changed files
with
10 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import path from 'node:path'; | ||
import { exec } from 'node:child_process'; | ||
import fs from 'node:fs/promises'; | ||
import { generateImportMap } from './generators/one-page'; | ||
import exp from 'constants'; | ||
|
||
const CLI_PATH = path.resolve(__dirname, '../bin/cli.js'); | ||
const TMP_PATH = path.resolve(__dirname, '../tmp'); | ||
|
@@ -214,16 +216,8 @@ describe('create-spectacle', () => { | |
.readFile(HTML_PATH, 'utf8') | ||
.then((buffer) => buffer.toString()); | ||
|
||
// Should have deps | ||
const deps = [ | ||
'https://unpkg.com/[email protected]/umd/react.production.min.js', | ||
'https://unpkg.com/[email protected]/umd/react-dom.production.min.js', | ||
'https://unpkg.com/[email protected]/umd/react-is.production.min.js', | ||
'https://unpkg.com/[email protected]/prop-types.min.js', | ||
'https://unpkg.com/spectacle@^9/dist/spectacle.min.js' | ||
]; | ||
deps.forEach((dep) => { | ||
expect(contents).toContain(`<script src="${dep}"></script>`); | ||
Array.from((await generateImportMap()).entries()).forEach(([pkg, url]) => { | ||
expect(contents).toContain(`"${pkg}": "${url}"`); | ||
}); | ||
}); | ||
}); | ||
|
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