Skip to content

Commit e5b0f7d

Browse files
committed
Try non-qml test 2
1 parent 3dc7d88 commit e5b0f7d

File tree

4 files changed

+181
-179
lines changed

4 files changed

+181
-179
lines changed

test/3d-qml.test.js

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1-
'use strict';
1+
// 'use strict';
22

33

4-
const assert = require('node:assert').strict;
5-
const { describe, it } = require('node:test');
4+
// const assert = require('node:assert').strict;
5+
// const { describe, it } = require('node:test');
66

7-
const inited = require('./init')();
8-
const { QmlOverlay, QmlMaterial, QmlOverlayMaterial, loop, window } = inited;
7+
// const inited = require('./init')();
8+
// const { QmlOverlay, QmlMaterial, QmlOverlayMaterial, loop, window } = inited;
99

10-
const initResults = [
11-
'QmlOverlay', 'QmlMaterial', 'QmlOverlayMaterial',
12-
'Property', 'Method', 'View',
13-
'loop', 'release', 'textureFromId',
14-
];
10+
// const initResults = [
11+
// 'QmlOverlay', 'QmlMaterial', 'QmlOverlayMaterial',
12+
// 'Property', 'Method', 'View',
13+
// 'loop', 'release', 'textureFromId',
14+
// ];
1515

16-
const initedClasses = {
17-
QmlOverlay: {
18-
create() {
19-
return new QmlOverlay({ file: `${__dirname}/test.qml` });
20-
},
21-
props: ['isVisible', 'isDisabled', 'material', 'mesh'],
22-
},
23-
QmlMaterial: {
24-
create() {
25-
return new QmlMaterial();
26-
},
27-
props: ['textureId'],
28-
},
29-
QmlOverlayMaterial: {
30-
create() {
31-
return new QmlOverlayMaterial();
32-
},
33-
props: ['textureId'],
34-
},
35-
};
16+
// const initedClasses = {
17+
// QmlOverlay: {
18+
// create() {
19+
// return new QmlOverlay({ file: `${__dirname}/test.qml` });
20+
// },
21+
// props: ['isVisible', 'isDisabled', 'material', 'mesh'],
22+
// },
23+
// QmlMaterial: {
24+
// create() {
25+
// return new QmlMaterial();
26+
// },
27+
// props: ['textureId'],
28+
// },
29+
// QmlOverlayMaterial: {
30+
// create() {
31+
// return new QmlOverlayMaterial();
32+
// },
33+
// props: ['textureId'],
34+
// },
35+
// };
3636

3737

38-
const tested = describe('Qml 3D Inited', () => {
39-
it('returns all init results', () => {
40-
initResults.forEach(
41-
(name) => assert.strictEqual(
42-
typeof inited[name],
43-
'function',
44-
`Init field "${name}" is missing.`,
45-
),
46-
);
47-
});
38+
// const tested = describe('Qml 3D Inited', () => {
39+
// it('returns all init results', () => {
40+
// initResults.forEach(
41+
// (name) => assert.strictEqual(
42+
// typeof inited[name],
43+
// 'function',
44+
// `Init field "${name}" is missing.`,
45+
// ),
46+
// );
47+
// });
4848

49-
Object.keys(initedClasses).forEach((c) => {
50-
it(`exports class "${c}"`, () => {
51-
assert.strictEqual(typeof inited[c], 'function');
52-
});
49+
// Object.keys(initedClasses).forEach((c) => {
50+
// it(`exports class "${c}"`, () => {
51+
// assert.strictEqual(typeof inited[c], 'function');
52+
// });
5353

54-
const current = initedClasses[c];
55-
const instance = current.create();
54+
// const current = initedClasses[c];
55+
// const instance = current.create();
5656

57-
it(`is valid instance of ${c}`, () => {
58-
assert.ok(
59-
instance instanceof inited[c],
60-
`Can't instantiate class "${c}".`,
61-
);
62-
});
57+
// it(`is valid instance of ${c}`, () => {
58+
// assert.ok(
59+
// instance instanceof inited[c],
60+
// `Can't instantiate class "${c}".`,
61+
// );
62+
// });
6363

64-
it(`exposes properties of "${c}"`, () => {
65-
current.props.forEach((prop) => {
66-
assert.ok(
67-
typeof instance[prop] !== 'undefined',
68-
`Property "${c}.${prop}" not found.`,
69-
);
70-
});
71-
});
72-
});
73-
});
64+
// it(`exposes properties of "${c}"`, () => {
65+
// current.props.forEach((prop) => {
66+
// assert.ok(
67+
// typeof instance[prop] !== 'undefined',
68+
// `Property "${c}.${prop}" not found.`,
69+
// );
70+
// });
71+
// });
72+
// });
73+
// });
7474

75-
(async () => {
76-
const stop = loop(() => {
75+
// (async () => {
76+
// const stop = loop(() => {
7777

78-
});
79-
await tested;
80-
stop();
81-
window.destroy();
82-
setTimeout(() => undefined, 500);
83-
})();
78+
// });
79+
// await tested;
80+
// stop();
81+
// window.destroy();
82+
// setTimeout(() => undefined, 500);
83+
// })();

test/compare.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ const assert = require('node:assert').strict;
44
const { describe, it } = require('node:test');
55
const three = require('three');
66

7-
const { screenshot } = require('./screenshot');
7+
// const { screenshot } = require('./screenshot');
88
const inited = require('./init')();
9-
const { window, QmlOverlay, loop, doc, Image } = inited;
9+
// const { window, QmlOverlay, loop, doc, Image } = inited;
10+
const { window, loop } = inited;
1011

1112
const renderer = new three.WebGLRenderer();
1213
renderer.setPixelRatio(window.devicePixelRatio);

test/init.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const three = require('three');
22
const { init, addThreeHelpers } = require('3d-core-raub');
3-
const { init: initQml } = require('..');
3+
// const { init: initQml } = require('..');
44

55
const initForTest = () => {
66
const node3d = init({
@@ -12,8 +12,9 @@ const initForTest = () => {
1212

1313
addThreeHelpers(three, gl);
1414

15-
const inited = initQml({ doc, gl, cwd: __dirname, three });
16-
return { ...node3d, ...inited };
15+
// const inited = initQml({ doc, gl, cwd: __dirname, three });
16+
// return { ...node3d, ...inited };
17+
return inited;
1718
};
1819

1920
module.exports = initForTest;

0 commit comments

Comments
 (0)