You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.js 1.8KB

123456789101112131415161718192021222324252627282930313233
  1. const assert = require("assert");
  2. const nodeApi = require(".");
  3. assert.strictEqual(nodeApi.fromNodeVersion("0.0.1"), undefined);
  4. assert.strictEqual(nodeApi.fromNodeVersion("9.0.0"), undefined);
  5. assert.strictEqual(nodeApi.fromNodeVersion("10.0.0"), 3);
  6. assert.strictEqual(nodeApi.fromNodeVersion("10.16.0"), 4);
  7. assert.strictEqual(nodeApi.fromNodeVersion("10.17.0"), 5);
  8. assert.strictEqual(nodeApi.fromNodeVersion("12.13.0"), 5);
  9. assert.strictEqual(nodeApi.fromNodeVersion("10.20.0"), 6);
  10. assert.strictEqual(nodeApi.fromNodeVersion("10.23.0"), 7);
  11. assert.strictEqual(nodeApi.fromNodeVersion("16.0.0"), 8);
  12. assert.strictEqual(nodeApi.fromNodeVersion("18.0.0"), 8);
  13. assert.strictEqual(nodeApi.fromElectronVersion("0.25.0"), undefined);
  14. assert.strictEqual(nodeApi.fromElectronVersion("1.0.0"), undefined);
  15. assert.strictEqual(nodeApi.fromElectronVersion("2.0.0"), undefined);
  16. assert.strictEqual(nodeApi.fromElectronVersion("3.0.0"), 3);
  17. assert.strictEqual(nodeApi.fromElectronVersion("4.0.0"), 3);
  18. assert.strictEqual(nodeApi.fromElectronVersion("5.0.0"), 4);
  19. assert.strictEqual(nodeApi.fromElectronVersion("6.0.0"), 4);
  20. assert.strictEqual(nodeApi.fromElectronVersion("7.0.0"), 4);
  21. assert.strictEqual(nodeApi.fromElectronVersion("8.0.0"), 5);
  22. assert.strictEqual(nodeApi.fromElectronVersion("9.0.0"), 5);
  23. assert.strictEqual(nodeApi.fromElectronVersion("10.0.0"), 5);
  24. assert.strictEqual(nodeApi.fromElectronVersion("11.0.0"), 6);
  25. assert.strictEqual(nodeApi.fromElectronVersion("12.0.0-nightly.20200827"), 6);
  26. assert.strictEqual(nodeApi.fromElectronVersion("12.0.0"), 7);
  27. assert.strictEqual(nodeApi.fromElectronVersion("13.0.0"), 7);
  28. assert.strictEqual(nodeApi.fromElectronVersion("14.0.0"), 7);
  29. assert.strictEqual(nodeApi.fromElectronVersion("15.0.0"), 8);
  30. assert.strictEqual(nodeApi.fromElectronVersion("16.0.0"), 8);
  31. assert.strictEqual(nodeApi.fromElectronVersion("28.0.0"), 8);