<commit_before>describe("VglArrowHelperのテスト", function() {
    const {VglArrowHelper} = VueGL;
    const assert = chai.assert;
    describe("プロパティの確認", function() {
        it("instプロパティはArrowHelperオブジェクト", function() {
            const vm = new Vue(VglArrowHelper);
            assert.isTrue(vm.inst.line.isLine);
            assert.isTrue(vm.inst.cone.isMesh);
        });
    });
    describe("プロパティのテスト", function() {
        describe("dirプロパティ", function() {
            it("\"0 2 0\" -> 0, 0, 0 (No rotation)", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 0"}
                });
                assert.strictEqual(vm.inst.rotation.x, 0);
                assert.strictEqual(vm.inst.rotation.y, 0);
                assert.strictEqual(vm.inst.rotation.z, 0);
            });
            it("\"0 2 2\" -> π/4, 0, 0", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 2"}
                });
                assert.closeTo(vm.inst.rotation.x, Math.PI / 4, 0.00000000000000012);
                assert.strictEqual(vm.inst.rotation.y, 0);
                assert.strictEqual(vm.inst.rotation.z, 0);
            });
        });
        describe("lengthプロパティ", function() {
            it("\"3.8\" -> 3.04 (3.8 - 3.8 * 0.2)", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: "3.8"}
                });
                assert.strictEqual(vm.inst.line.scale.y, 3.04);
            });
        });
        describe("headLengthプロパティ", function() {
            it("\"1.1\" -> 1.1 with length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 5, headLength: "1.1"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 1.1);
            });
            it("\".1\" -> 0.1 without length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headLength: ".1"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 0.1);
            });
        });
        describe("headWidthプロパティ", function() {
            it("\"1.2\" -> 1.2 with length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 4, headWidth: "1.2"}
                });
                assert.strictEqual(vm.inst.cone.scale.x, 1.2);
            });
            it("\".2\" -> 0.2 without length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headWidth: ".2"}
                });
                assert.strictEqual(vm.inst.cone.scale.x, 0.2);
            });
        });
        describe("colorプロパティ", function() {
            it("#676767", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {color: "#676767"}
                });
                assert.strictEqual(vm.inst.line.material.color.getHex(), 0x676767);
            });
        });
    });
    describe("プロパティ変更のテスト", function() {
        describe("dirの変更", function() {
            it("\"0 2 0\" -> \"0 2 2\"", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 0"}
                });
                assert.strictEqual(vm.inst.rotation.x, 0);
                vm.dir = "0 2 2";
                return vm.$nextTick().then(() => {
                    assert.closeTo(vm.inst.rotation.x, Math.PI / 4, 0.00000000000000012);
                });
            });
        });
        describe("lengthの変更", function() {
            it("3 -> \"5\"", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 3}
                });
                assert.strictEqual(vm.inst.line.scale.y, 2.4);
                vm.length = "5";
                return vm.$nextTick().then(() => {
                    assert.strictEqual(vm.inst.line.scale.y, 4);
                });
            });
        });
        describe("headLengthの変更", function() {
            it("\".25\" -> 0.35", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headLength: ".25"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 0.25);
                vm.headLength = 0.35;
                return vm.$nextTick().then(() => {
                    assert.strictEqual(vm.inst.cone.scale.y, 0.35);
                });
            });
        });
        describe("headWidthの変更", function() {
            it("\".15\" -> 0.25", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headWidth: ".15"}
                });
                assert.strictEqual(vm.inst.cone.scale.z, 0.15);
                vm.headWidth = 0.25;
                return vm.$nextTick().then(() => {
                    assert.strictEqual(vm.inst.cone.scale.z, 0.25);
                });
            });
        });
        describe("colorの変更", function() {
            it("#ffdd77 -> #ab76c5", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {color: "#ffdd77"}
                });
                assert.strictEqual(vm.inst.cone.material.color.getHex(), 0xffdd77);
                vm.color = "#ab76c5";
                return vm.$nextTick().then(() => {
                    assert.strictEqual(vm.inst.cone.material.color.getHex(), 0xab76c5);
                });
            });
        });
    });
});<commit_msg>Stop using promise for old browsers compatibility.<commit_after>describe("VglArrowHelperのテスト", function() {
    const {VglArrowHelper} = VueGL;
    const assert = chai.assert;
    describe("プロパティの確認", function() {
        it("instプロパティはArrowHelperオブジェクト", function() {
            const vm = new Vue(VglArrowHelper);
            assert.isTrue(vm.inst.line.isLine);
            assert.isTrue(vm.inst.cone.isMesh);
        });
    });
    describe("プロパティのテスト", function() {
        describe("dirプロパティ", function() {
            it("\"0 2 0\" -> 0, 0, 0 (No rotation)", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 0"}
                });
                assert.strictEqual(vm.inst.rotation.x, 0);
                assert.strictEqual(vm.inst.rotation.y, 0);
                assert.strictEqual(vm.inst.rotation.z, 0);
            });
            it("\"0 2 2\" -> π/4, 0, 0", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 2"}
                });
                assert.closeTo(vm.inst.rotation.x, Math.PI / 4, 0.00000000000000012);
                assert.strictEqual(vm.inst.rotation.y, 0);
                assert.strictEqual(vm.inst.rotation.z, 0);
            });
        });
        describe("lengthプロパティ", function() {
            it("\"3.8\" -> 3.04 (3.8 - 3.8 * 0.2)", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: "3.8"}
                });
                assert.strictEqual(vm.inst.line.scale.y, 3.04);
            });
        });
        describe("headLengthプロパティ", function() {
            it("\"1.1\" -> 1.1 with length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 5, headLength: "1.1"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 1.1);
            });
            it("\".1\" -> 0.1 without length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headLength: ".1"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 0.1);
            });
        });
        describe("headWidthプロパティ", function() {
            it("\"1.2\" -> 1.2 with length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 4, headWidth: "1.2"}
                });
                assert.strictEqual(vm.inst.cone.scale.x, 1.2);
            });
            it("\".2\" -> 0.2 without length", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headWidth: ".2"}
                });
                assert.strictEqual(vm.inst.cone.scale.x, 0.2);
            });
        });
        describe("colorプロパティ", function() {
            it("#676767", function() {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {color: "#676767"}
                });
                assert.strictEqual(vm.inst.line.material.color.getHex(), 0x676767);
            });
        });
    });
    describe("プロパティ変更のテスト", function() {
        describe("dirの変更", function() {
            it("\"0 2 0\" -> \"0 2 2\"", function(done) {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {dir: "0 2 0"}
                });
                assert.strictEqual(vm.inst.rotation.x, 0);
                vm.dir = "0 2 2";
                vm.$nextTick(() => {
                    assert.closeTo(vm.inst.rotation.x, Math.PI / 4, 0.00000000000000012);
                    done();
                });
            });
        });
        describe("lengthの変更", function() {
            it("3 -> \"5\"", function(done) {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {length: 3}
                });
                assert.strictEqual(vm.inst.line.scale.y, 2.4);
                vm.length = "5";
                vm.$nextTick(() => {
                    assert.strictEqual(vm.inst.line.scale.y, 4);
                    done();
                });
            });
        });
        describe("headLengthの変更", function() {
            it("\".25\" -> 0.35", function(done) {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headLength: ".25"}
                });
                assert.strictEqual(vm.inst.cone.scale.y, 0.25);
                vm.headLength = 0.35;
                vm.$nextTick(() => {
                    assert.strictEqual(vm.inst.cone.scale.y, 0.35);
                    done();
                });
            });
        });
        describe("headWidthの変更", function() {
            it("\".15\" -> 0.25", function(done) {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {headWidth: ".15"}
                });
                assert.strictEqual(vm.inst.cone.scale.z, 0.15);
                vm.headWidth = 0.25;
                vm.$nextTick(() => {
                    assert.strictEqual(vm.inst.cone.scale.z, 0.25);
                    done();
                });
            });
        });
        describe("colorの変更", function() {
            it("#ffdd77 -> #ab76c5", function(done) {
                const vm = new (Vue.extend(VglArrowHelper))({
                    propsData: {color: "#ffdd77"}
                });
                assert.strictEqual(vm.inst.cone.material.color.getHex(), 0xffdd77);
                vm.color = "#ab76c5";
                return vm.$nextTick(() => {
                    assert.strictEqual(vm.inst.cone.material.color.getHex(), 0xab76c5);
                    done();
                });
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.16508128675198894, 'fraction_numerical': 0.0337253545485991, 'mean_word_length': 1.3001193317422435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7563440', 'n_tokens_mistral': 3749, 'n_tokens_neox': 3364, 'n_words': 559}