Skip to content

Commit b555774

Browse files
committed
Fix tests and lints
1 parent 40f18ce commit b555774

File tree

10 files changed

+24
-208
lines changed

10 files changed

+24
-208
lines changed

.github/workflows/eslint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ jobs:
1212
Eslint:
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04]
15+
os: [ubuntu-latest]
1616

1717
runs-on: ${{ matrix.os }}
1818

1919
steps:
2020

2121
- name: Fetch Repository
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
2525

2626
- name: Install Node.js
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: 22.14.0
3030
cache: 'npm'

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
steps:
1515

1616
- name: Fetch Repository
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
persist-credentials: false
2020

2121
- name: Install Node.js
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: 22.14.0
2525
cache: 'npm'
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Create Release
3939
id: create_release
40-
uses: softprops/action-gh-release@v1
40+
uses: softprops/action-gh-release@v2
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
with:

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ jobs:
1212
Test:
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04]
15+
os: [ubuntu-22.04]
1616

1717
runs-on: ${{ matrix.os }}
1818

1919
steps:
2020

2121
- name: Fetch Repository
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
2525

2626
- name: Install Node.js
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: 22.14.0
3030
cache: 'npm'
@@ -33,7 +33,7 @@ jobs:
3333
run: npm ci
3434

3535
- name: Run Unit Tests
36-
if: matrix.os == 'ubuntu-20.04'
36+
if: matrix.os == 'ubuntu-22.04'
3737
run: |
3838
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ci
39-
xvfb-run --auto-servernum npm run test
39+
xvfb-run --auto-servernum npm run test-ci

examples/index.cjs

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/shader.js

Lines changed: 0 additions & 131 deletions
This file was deleted.

examples/textures/texture_2.jpg

-70.2 KB
Binary file not shown.

examples/textures/texture_3.jpg

-572 Bytes
Binary file not shown.

js/shape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { Body } = require('bullet-raub');
66
const _init = ({ scene, three }) => {
77
class Shape extends Body {
88

9-
constructor(opts) {
9+
constructor(opts = {}) {
1010
const { sceneBullet, sceneThree, mesh, debug, color, ...rest } = opts;
1111
const sceneFinal = sceneBullet || scene;
1212
super({ ...rest, scene: sceneFinal });

test/3d-bullet.test.js

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
11
'use strict';
22

3-
43
const assert = require('node:assert').strict;
54
const { describe, it } = require('node:test');
65
const three = require('three');
7-
const { init, addThreeHelpers } = require('3d-core-raub');
8-
const { init: initQml } = require('..');
6+
const { init } = require('3d-core-raub');
7+
const { init: initBullet } = require('..');
98

10-
const {
11-
doc, gl,
12-
} = init({
13-
isGles3: true, isWebGL2: true,
14-
});
9+
init();
1510

16-
addThreeHelpers(three, gl);
17-
18-
const inited = initQml({ doc, gl, cwd: __dirname, three });
11+
const inited = initBullet({ three });
1912

2013
const {
21-
QmlOverlay, QmlMaterial, QmlOverlayMaterial, View,
14+
Shape, scene,
2215
} = inited;
2316

2417
const initResults = [
25-
'QmlOverlay', 'QmlMaterial', 'QmlOverlayMaterial',
26-
'Property', 'Method', 'View',
27-
'loop', 'release', 'textureFromId',
18+
'Shape', 'scene', 'bullet',
2819
];
2920

3021
const initedClasses = {
31-
QmlOverlay: {
32-
create() {
33-
return new QmlOverlay({ file: `${__dirname}/qml/Hud.qml` });
34-
},
35-
props: ['isVisible', 'isDisabled', 'material', 'mesh'],
36-
},
37-
QmlMaterial: {
38-
create() {
39-
return new QmlMaterial();
40-
},
41-
props: ['textureId'],
42-
},
43-
QmlOverlayMaterial: {
22+
Shape: {
4423
create() {
45-
return new QmlOverlayMaterial();
24+
return new Shape();
4625
},
47-
props: ['textureId'],
26+
props: ['debug', 'mesh'],
4827
},
4928
};
5029

5130

52-
const tested = describe('Qml 3D Inited', () => {
31+
const tested = describe('Bullet 3D Inited', async () => {
5332
it('returns all init results', () => {
5433
initResults.forEach(
55-
(name) => assert.strictEqual(
34+
(name) => assert.ok(
5635
typeof inited[name],
57-
'function',
5836
`Init field "${name}" is missing.`,
5937
),
6038
);
@@ -87,7 +65,7 @@ const tested = describe('Qml 3D Inited', () => {
8765
});
8866

8967
(async () => {
90-
const interv = setInterval(View.update, 15);
68+
const interv = setInterval(() => scene.update(), 15);
9169
await tested;
9270
clearInterval(interv);
9371
})();

test/test.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)