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

replace mocha+chai with flug? #84

Open
DanielJDufour opened this issue Mar 18, 2023 · 0 comments
Open

replace mocha+chai with flug? #84

DanielJDufour opened this issue Mar 18, 2023 · 0 comments

Comments

@DanielJDufour
Copy link
Collaborator

I'm weighing the pros and cons of replacing mocha and chai with flug.

Although they are popular, dependabot occasionally flags security vulnerabilities with these libraries and I'd rather not bother with the hassle if there is an alternative. Additionally, I prefer the simpler syntax of flug.

with mocha + cai

const should = require('chai').should(); // eslint-disable-line no-unused-vars

describe ('third mgrs set', () => {
  const mgrsStr = '11SPA7234911844';
  const point = [-115.0820944, 36.2361322];
  it('MGRS reference with highest accuracy correct.', () => {
    mgrs.forward(point).should.equal(mgrsStr);
  });
  it('MGRS reference with 0-digit accuracy correct.', () => {
    mgrs.forward(point, 0).should.equal('11SPA');
  });
});

with flug

test('third mgrs set', ({ eq }) => {
  const mgrsStr = '11SPA7234911844';
  const point = [-115.0820944, 36.2361322];
  eq(mgrs.forward(point), mgrsStr); // with highest accuracy
  eq(mgrs.forward(point, 0), '11SPA'); // with 0-digit accuracy
});

Open to your thoughts and opinions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant