{"size": 740, "ext": "js", "max_stars_repo_path": "cidr_convert_api/node/test/cidrtomask.js", "max_stars_repo_name": "andreapao1/DOTT", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "cidr_convert_api/node/test/cidrtomask.js", "max_issues_repo_name": "andreapao1/DOTT", "max_issues_repo_issues_event_min_datetime": "2020-12-15T16:39:17.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-21T07:06:50.000Z", "max_forks_repo_path": "cidr_convert_api/node/test/cidrtomask.js", "max_forks_repo_name": "andreapao1/DOTT", "max_forks_repo_forks_event_min_datetime": "2020-03-13T20:16:03.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-14T22:34:40.000Z"}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": 68, "avg_line_length": 30.8333333333, "max_line_length": 68, "alphanum_fraction": 0.6391891892}
import chai from 'chai';
import { cidrToMaskFunction } from '../services/cidrtomask'

const expect = chai.expect;

describe('cidrToMaskFunction()', function () {
  it('should return a mask', function () {

    expect("255.0.0.0").to.be.equal(cidrToMaskFunction("8"));
    expect("255.255.0.0").to.be.equal(cidrToMaskFunction("16"));
    expect("255.255.255.0").to.be.equal(cidrToMaskFunction("24"));
    expect("255.255.255.255").to.be.equal(cidrToMaskFunction("32"));
  });

  it('should return an invalid', function () {
    expect("Invalid").to.be.equal("Invalid");
    expect("0").to.be.equal("Invalid");
    expect("33").to.be.equal("Invalid");
    expect("a").to.be.equal("Invalid");
    expect("").to.be.equal("Invalid");
  });

});
