message: add failing test for recompile after invalidation
diff: @@ -7,12 +7,7 @@ if (process.env.COMPILER) {
  describe('SearchIndex', function () {
  let { getRealmDir, getContainer, realmURL, cards } = configureHubWithCompiler(this);
  - this.beforeEach(async function () {
  - let si = await getContainer().lookup('searchIndex');
  - await si.indexAllRealms();
  - });
  -
  - it(`gives a good error when a card can't compile`, async function () {
  + it(`gives a good error at load time when a card can't compile`, async function () {
  outputJSONSync(join(getRealmDir(), 'example', 'card.json'), { adoptsFrom: '../post' });
  let si = await getContainer().lookup('searchIndex');
  await si.indexAllRealms();
  @@ -27,5 +22,37 @@ if (process.env.COMPILER) {
  expect(innerError?.status).to.eq(404);
  }
  });
  +
  + it.skip(`recovers automatically from a bad compile once the problem is addressed`, async function () {
  + outputJSONSync(join(getRealmDir(), 'example', 'card.json'), {
  + adoptsFrom: '../post',
  + data: { title: 'Hello World' },
  + });
  + let si = await getContainer().lookup('searchIndex');
  + await si.indexAllRealms();
  +
  + // at this point we expect loading of `example` is broken because it's
  + // missing its adoption parent. This precondition is proved by the
  + // previous test.
  +
  + await cards.create({
  + realm: realmURL,
  + id: 'post',
  + schema: 'schema.js',
  + files: {
  + 'schema.js': `
  + import { contains } from '@cardstack/types';
  + import string from 'https://cardstack.com/base/string';
  + export default class Post {
  + @contains(string)
  + title;
  + }
  + `,
  + },
  + });
  +
  + let example = await cards.load(`${realmURL}example`);
  + expect(example.data?.title).to.eq('Hello World');
  + });
  });
  }
  