browser_gcli_fileparser.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2012, Mozilla Foundation and contributors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. "use strict";
  17. // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
  18. // PLEASE TALK TO SOMEONE IN DEVELOPER TOOLS BEFORE EDITING IT
  19. const exports = {};
  20. function test() {
  21. helpers.runTestModule(exports, "browser_gcli_fileparser.js");
  22. }
  23. // var assert = require('../testharness/assert');
  24. var fileparser = require("gcli/util/fileparser");
  25. var local = false;
  26. exports.testGetPredictor = function (options) {
  27. if (!options.isNode || !local) {
  28. assert.log("Skipping tests due to install differences.");
  29. return;
  30. }
  31. var opts = { filetype: "file", existing: "yes" };
  32. var predictor = fileparser.getPredictor("/usr/locl/bin/nmp", opts);
  33. return predictor().then(function (replies) {
  34. assert.is(replies[0].name,
  35. "/usr/local/bin/npm",
  36. "predict npm");
  37. });
  38. };