MCPcopy
hub / github.com/electerm/electerm / createTestFiles

Function createTestFiles

test/unit/load-widget.spec.js:18–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17 // Helper to create test files
18 async function createTestFiles () {
19 testDir = path.join(os.tmpdir(), 'electerm-test-' + Date.now())
20 await fs.mkdir(testDir)
21
22 // Create a test index.html
23 const htmlContent = `
24 <!DOCTYPE html>
25<html>
26<head>
27<title>
28Test Page
29
30</title>
31</head>
32<body>
33<h1>
34Hello from Electerm Test
35
36</h1>
37<p>
38This is a test page served by local-file-server widget.
39
40</p>
41<p>
42Timestamp: ${new Date().toISOString()}
43
44</p>
45</body>
46</html>
47`
48 await fs.writeFile(path.join(testDir, 'index.html'), htmlContent)
49 }
50
51 // Cleanup helper
52 async function cleanup () {

Callers 1

Calls 2

mkdirMethod · 0.45
writeFileMethod · 0.45

Tested by

no test coverage detected