Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adds idilize tests and removes ci tests for now #12

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,3 @@ jobs:

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr test
126 changes: 52 additions & 74 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,88 +1,66 @@
<!DOCTYPE html>
<!--
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<head>
<meta charset="utf-8" />
<title>Mocha Tests</title>
</head>
<body>
<div id="mocha"></div>

</head>
<body>
<div id="mocha"></div>
<!-- Mocha and Sinon stopped supporting older IE: -->
<!--[if IE 9]>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/4.1.0/mocha.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/4.1.0/mocha.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sinon.js/5.1.0/sinon.min.js"></script>
<![endif]-->
<!--[if !IE]><!-->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.2.0/mocha.min.css" rel="stylesheet">
<link
href="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.2.0/mocha.min.css"
rel="stylesheet"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.2.0/mocha.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sinon.js/6.1.5/sinon.min.js"></script>
<!--<![endif]-->

<!-- Chai works fine in all browsers -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.1.2/chai.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.1.2/chai.min.js"></script>

<script>
mocha.ui('bdd');
mocha.timeout(60000);
<script>
mocha.ui('bdd')
mocha.timeout(60000)

// Expose chai's assert globally.
self.assert = chai.assert;
</script>
// Expose chai's assert globally.
self.assert = chai.assert
</script>

<script type="module" src="idle-callback-polyfills-test.mjs"></script>
<script type="module" src="defineIdleProperties-test.mjs"></script>
<script type="module" src="defineIdleProperty-test.mjs"></script>
<script type="module" src="IdleQueue-test.mjs"></script>
<script type="module" src="IdleValue-test.mjs"></script>
<script type="module" src="idle-callback-polyfills-test.mjs"></script>
<script type="module" src="defineIdleProperties-test.mjs"></script>
<script type="module" src="defineIdleProperty-test.mjs"></script>
<script type="module" src="IdleQueue-test.mjs"></script>
<script type="module" src="IdleValue-test.mjs"></script>

<!-- The bundled scripts for nomodule browsers -->
<script nomodule src="index.js"></script>
<!-- The bundled scripts for nomodule browsers -->
<script nomodule src="index.js"></script>

<script>
window.onload = function() {
var runner = mocha.run();
var failedTests = [];
<script>
window.onload = function () {
var runner = mocha.run()
var failedTests = []

runner.on('end', function(){
window.mochaResults = runner.stats;
window.mochaResults.reports = failedTests;
});
runner.on('end', function () {
window.mochaResults = runner.stats
window.mochaResults.reports = failedTests
})

runner.on('fail', function(test, err){
var flattenTitles = function(test){
var titles = [];
while (test.parent.title){
titles.push(test.parent.title);
test = test.parent;
}
return titles.reverse();
};
runner.on('fail', function (test, err) {
var flattenTitles = function (test) {
var titles = []
while (test.parent.title) {
titles.push(test.parent.title)
test = test.parent
}
return titles.reverse()
}

failedTests.push({
name: test.title,
result: false,
message: err.message,
stack: err.stack,
titles: flattenTitles(test)
});
});
};
</script>
</body>
failedTests.push({
name: test.title,
result: false,
message: err.message,
stack: err.stack,
titles: flattenTitles(test)
})
})
}
</script>
</body>
</html>
Empty file removed test/index.test.ts
Empty file.
Loading