Skip to content

Commit

Permalink
Update async references in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-cc committed Feb 7, 2023
1 parent 76c1e52 commit 8f896d7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions tests/generators/collections.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const processedCompanyPost = {
tags: ['posts', 'company'],
};

test('gets collections', (t) => {
test('gets collections', async (t) => {
const context = {
collections: {
all: [
Expand Down Expand Up @@ -197,7 +197,7 @@ test('gets collections', (t) => {
}
};

t.deepEqual(getCollections(collectionsConfig, context, config), {
t.deepEqual(await getCollections(collectionsConfig, context, config), {
pages: [
processedPage,
{ ...processedPage, _unlisted: true },
Expand Down
4 changes: 2 additions & 2 deletions tests/generators/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const processedInfo = {
version: '0.0.3'
};

test('gets info', (t) => {
test('gets info', async (t) => {
const context = {
pkg: {
dependencies: { '@11ty/eleventy': '1' }
Expand All @@ -157,7 +157,7 @@ test('gets info', (t) => {
}
};

const result = getInfo(context, config);
const result = await getInfo(context, config);
t.deepEqual({ ...result, time: null }, processedInfo);

const time = result.time.substring(0, 10);
Expand Down
20 changes: 10 additions & 10 deletions tests/util/items.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,32 @@ test('is page', (t) => {
t.falsy(isPage(collectionItem));
});

test('processes item', (t) => {
t.deepEqual(processItem(page, 'pages', '.'), processedPage);
test('processes item', async (t) => {
t.deepEqual(await processItem(page, 'pages', '.'), processedPage);
});

test('processes item in custom source', (t) => {
test('processes item in custom source', async (t) => {
const customPage = {
...page,
inputPath: './src/page.html'
};

t.deepEqual(processItem(customPage, 'pages', 'src'), processedPage);
t.deepEqual(await processItem(customPage, 'pages', 'src'), processedPage);
});

test('processes invalid item', (t) => {
t.is(processItem({}, 'pages', '.'), undefined);
test('processes invalid item', async (t) => {
t.is(await processItem({}, 'pages', '.'), undefined);
});

test('processes unlisted item', (t) => {
t.deepEqual(processItem(unlistedPage, 'pages', '.'), {
test('processes unlisted item', async (t) => {
t.deepEqual(await processItem(unlistedPage, 'pages', '.'), {
...processedPage,
_unlisted: true
});
});

test('processes non output item', (t) => {
t.deepEqual(processItem(nonOutputPage, 'pages', '.'), {
test('processes non output item', async (t) => {
t.deepEqual(await processItem(nonOutputPage, 'pages', '.'), {
...processedPage,
url: '',
output: false
Expand Down

0 comments on commit 8f896d7

Please sign in to comment.