Latest repo

This commit is contained in:
Marc
2025-06-02 16:42:16 +00:00
parent 53ddf1a329
commit cde5fae175
27907 changed files with 3875388 additions and 1 deletions

16
node_modules/classlist-polyfill/tests/qunit.html generated vendored Normal file
View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit Tests</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
<script src="../classList.js"></script>
<script src="tests.js"></script>
<script src="remove.js"></script>
</body>
</html>

10
node_modules/classlist-polyfill/tests/remove.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
QUnit.module("classList.remove");
QUnit.test("Removes duplicated instances of class", function(assert) {
var el = document.createElement("p"), cList = el.classList;
el.className = "ho ho ho"
cList.remove("ho");
assert.ok(!cList.contains("ho"), "Should remove all instances of 'ho'");
assert.strictEqual(el.className, "")
});

46
node_modules/classlist-polyfill/tests/runner.coffee generated vendored Normal file
View File

@@ -0,0 +1,46 @@
urls = require('system').args.slice(1)
page = require('webpage').create()
timeout = 3000
qunitHooks = ->
window.document.addEventListener 'DOMContentLoaded', ->
for callback in ['log', 'testDone', 'done']
do (callback) ->
QUnit[callback] (result) ->
window.callPhantom
name: "QUnit.#{callback}"
data: result
page.onInitialized = -> page.evaluate qunitHooks
page.onConsoleMessage = (msg) -> console.log msg
page.onCallback = (event) ->
if event.name is 'QUnit.log'
details = event.data
if details.result is false
console.log "#{details.module}: #{details.name}"
if details.message and details.message isnt "failed"
console.log " #{details.message}"
if "actual" of details
console.log " expected: #{details.expected}"
console.log " actual: #{details.actual}"
else if event.name is 'QUnit.testDone'
result = event.data
unless result.failed
console.log "✔︎ #{result.module}: #{result.name}"
else if event.name is 'QUnit.done'
res = event.data
console.log "#{res.total} tests, #{res.failed} failed. Done in #{res.runtime} ms"
phantom.exit if !res.total or res.failed then 1 else 0
for url in urls
page.open url, (status) ->
if status isnt 'success'
console.error "failed opening #{url}: #{status}"
phantom.exit 1
else
setTimeout ->
console.error "ERROR: Test execution has timed out"
phantom.exit 1
, timeout

82
node_modules/classlist-polyfill/tests/tests.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
QUnit.module("classList.toggle");
QUnit.test("Adds a class", function(assert) {
var cList = document.createElement("p").classList;
cList.toggle("c1");
assert.ok(cList.contains("c1"), "Adds a class that is not present");
assert.strictEqual(
cList.toggle("c2"),
true,
"Returns true when class is added"
);
});
QUnit.test("Removes a class", function(assert) {
var cList = document.createElement("p").classList;
cList.add("c1");
cList.toggle("c1");
assert.ok(!cList.contains("c1"), "Removes a class that is present");
cList.add("c2");
assert.strictEqual(
cList.toggle("c2"),
false,
"Return false when class is removed"
);
});
QUnit.test("Adds class with second argument", function(assert) {
var cList = document.createElement("p").classList;
cList.toggle("c1", true);
assert.ok(cList.contains("c1"), "Adds a class");
assert.strictEqual(
cList.toggle("c2", true),
true,
"Returns true when class is added"
);
cList.add("c3");
cList.toggle("c3", true);
assert.ok(
cList.contains("c3"),
"Does not remove a class that is already present"
);
cList.add("c4");
assert.strictEqual(
cList.toggle("c4", true),
true,
"Returns true when class is already present"
);
});
QUnit.test("Removes class with second argument", function(assert) {
var cList = document.createElement("p").classList;
cList.add("c1");
cList.toggle("c1", false);
assert.ok(!cList.contains("c1"), "Removes a class");
assert.strictEqual(
cList.toggle("c2", false),
false,
"Returns false when class is removed"
);
cList.toggle("c3", false);
assert.ok(
!cList.contains("c3"),
"Does not add a class that is not present"
);
assert.strictEqual(
cList.toggle("c4", false),
false,
"Returns false when class was not present"
);
});