<commit_before>var expect = require('chai').expect;
var Windrose = require('../windrose.js');

describe('Windrose', function () {

    it('should have method getPoint', function (done) {
        expect(typeof Windrose.getPoint).to.equal('function');
        done();
    });

    it('should have method getDegrees', function (done) {
        expect(typeof Windrose.getDegrees).to.equal('function');
        done();
    });

    describe('getPoint', function () {
        it('should return north when passing 0 degrees', function (done) {
            var res = Windrose.getPoint(0);
            expect(res).to.be.an('object');
            expect(res.symbol).to.equal('N');
            done();
        });

        it('should return North when passing 360 degrees', function (done) {
            var res = Windrose.getPoint(359.8);
            expect(res).to.be.an('object');
            expect(res.symbol).to.equal('N');
            done();
        });

        it('should return undefined when passing -1 degrees', function (done) {
            var res = Windrose.getPoint(-1);
            expect(res).to.be.an('undefined');
            done();
        });

        it('should return undefined when passing 361 degrees', function (done) {
            var res = Windrose.getPoint(361);
            expect(res).to.be.an('undefined');
            done();
        });

        it('should return N when passing 15 degrees with 0 depth', function (done) {
          var res = Windrose.getPoint(15, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('N');

          done();
        });

        it('should return S when passing 200 degrees with 0 depth', function (done) {
          var res = Windrose.getPoint(200, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('S');

          done();
        });

        it('should return SW when passing 220 degrees with 1 depth', function (done) {
          var res = Windrose.getPoint(220, { depth: 1 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('SW');

          done();
        });

        it('should return WNW when passing 293 degrees with 2 depth', function (done) {
          var res = Windrose.getPoint(293, { depth: 2 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('WNW');

          done();
        });

        it('should return undefined when passing invalid depth', function (done) {
          var res = Windrose.getPoint(15, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('N');

          done();
        });<commit_msg>New test - getPoint 359 with depth 2 should give N<commit_after>var expect = require('chai').expect;
var Windrose = require('../windrose.js');

describe('Windrose', function () {

    it('should have method getPoint', function (done) {
        expect(typeof Windrose.getPoint).to.equal('function');
        done();
    });

    it('should have method getDegrees', function (done) {
        expect(typeof Windrose.getDegrees).to.equal('function');
        done();
    });

    describe('getPoint', function () {
        it('should return north when passing 0 degrees', function (done) {
            var res = Windrose.getPoint(0);
            expect(res).to.be.an('object');
            expect(res.symbol).to.equal('N');
            done();
        });

        it('should return North when passing 360 degrees', function (done) {
            var res = Windrose.getPoint(359.8);
            expect(res).to.be.an('object');
            expect(res.symbol).to.equal('N');
            done();
        });

        it('should return undefined when passing -1 degrees', function (done) {
            var res = Windrose.getPoint(-1);
            expect(res).to.be.an('undefined');
            done();
        });

        it('should return undefined when passing 361 degrees', function (done) {
            var res = Windrose.getPoint(361);
            expect(res).to.be.an('undefined');
            done();
        });

        it('should return N when passing 15 degrees with 0 depth', function (done) {
          var res = Windrose.getPoint(15, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('N');

          done();
        });

        it('should return S when passing 200 degrees with 0 depth', function (done) {
          var res = Windrose.getPoint(200, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('S');

          done();
        });

        it('should return SW when passing 220 degrees with 1 depth', function (done) {
          var res = Windrose.getPoint(220, { depth: 1 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('SW');

          done();
        });

        it('should return WNW when passing 293 degrees with 2 depth', function (done) {
          var res = Windrose.getPoint(293, { depth: 2 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('WNW');

          done();
        });

        it('should return N when passing 359 degrees with 2 depth', function (done) {
          var res = Windrose.getPoint(359, { depth: 2 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('N');

          done();
        });

        it('should return undefined when passing invalid depth', function (done) {
          var res = Windrose.getPoint(15, { depth: 0 });
          expect(res).to.be.an('object');
          expect(res.symbol).to.equal('N');

          done();
        });
{'fraction_non_alphanumeric': 0.1575789659431798, 'fraction_numerical': 0.019763543320981118, 'mean_word_length': 2.040772532188841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '2584901', 'n_tokens_mistral': 1678, 'n_tokens_neox': 1544, 'n_words': 395}