<commit_before>import selftest, { Sandbox } from '../tool-testing/selftest.js';
import catalog from '../packaging/catalog/catalog.js';

const DEFAULT_RELEASE_TRACK = catalog.DEFAULT_TRACK;
const SIMPLE_WAREHOUSE = {
  v1: { },
  v2: { recommended: true }
};

selftest.define("'meteor update' alters `.meteor/packages`", () => {
  const s = new Sandbox({
    warehouse: SIMPLE_WAREHOUSE,
    fakeMongo: true
  });

  s.createApp("myapp", "very-simple-app-with-no-package-constraints");
  s.cd("myapp");

  s.write('.meteor/release', DEFAULT_RELEASE_TRACK + '@v1');
  run = s.run("update");
  run.match("updated to Meteor v2");
  run.expectExit(0);

  const packages = s.read(".meteor/packages");
  if (!packages.match('meteor-base@')) {
    selftest.fail("Failed to add a version specifier to `meteor-base` package");
  }
});<commit_msg>Updated update test to work properly<commit_after>import selftest, { Sandbox } from '../tool-testing/selftest.js';
import catalog from '../packaging/catalog/catalog.js';

const DEFAULT_RELEASE_TRACK = catalog.DEFAULT_TRACK;
const SIMPLE_WAREHOUSE = {
  v1: { },
  v2: { recommended: true }
};

selftest.define("'meteor update' alters `.meteor/packages`", () => {
  const s = new Sandbox({
    warehouse: SIMPLE_WAREHOUSE,
    fakeMongo: true
  });

  s.createApp("myapp", "very-simple-app-with-no-package-constraints", {
    release: DEFAULT_RELEASE_TRACK + '@v1'
  });
  s.cd("myapp");

  run = s.run("update");
  run.match("updated to Meteor v2");
  run.expectExit(0);

  const packages = s.read(".meteor/packages");
  if (!packages.match('meteor-base@')) {
    selftest.fail("Failed to add a version specifier to `meteor-base` package");
  }
});
{'fraction_non_alphanumeric': 0.17280285035629453, 'fraction_numerical': 0.0059382422802850355, 'mean_word_length': 4.21671826625387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1333495', 'n_tokens_mistral': 606, 'n_tokens_neox': 586, 'n_words': 119}