Skip to content

Commit

Permalink
chore: work on depgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
learosema committed Oct 14, 2024
1 parent f503005 commit 67674df
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/dependency-graph.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';

describe('Dependency Graph', () => {

const withFrontmatter = (str, data) => `---json\n${JSON.stringify(data)}\n---\n${str}`

function setupVFS(files) {
const vFS = new Map();
for (const [file, content] of Object.entries(files)) {
vFS.set(file, content);
}
return (...paths) => {
const resource = path.normalize(path.join(...paths));
return vFS.get(resource);
}
}


it('should return a map, mapping each dependants per file', () => {
const resolve = setupVFS({
'index.html': withFrontmatter('# {{ title }}', {title: 'Hello', layout: 'base.html'})
});


});
});

0 comments on commit 67674df

Please sign in to comment.