Rename `demoData` folders to `example` (#435)
The Git and GitHub plugins have folders that contain small example data, as used for tests and snapshots. These folders were called `demoData` which is misleading since the data isn't used for demos. The folders themselves contained files called "example", like "example-github.json" or "exampleRepo.js". Renaming the folders to `example` is cleaner. Test plan: `yarn travis --full` passes.
This commit is contained in:
parent
38942d1f7b
commit
529f7db374
|
@ -5,7 +5,7 @@ import fs from "fs";
|
|||
import {
|
||||
createExampleRepo,
|
||||
createExampleSubmoduleRepo,
|
||||
} from "../demoData/exampleRepo";
|
||||
} from "../example/exampleRepo";
|
||||
|
||||
function parseArgs() {
|
||||
const argv = process.argv.slice(2);
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
import {GraphView} from "./graphView";
|
||||
import type {Hash, Tree} from "./types";
|
||||
|
||||
const makeData = () => cloneDeep(require("./demoData/example-git"));
|
||||
const makeData = () => cloneDeep(require("./example/example-git"));
|
||||
|
||||
describe("plugins/git/createGraph", () => {
|
||||
describe("createGraph", () => {
|
||||
|
|
|
@ -4,14 +4,14 @@ import cloneDeep from "lodash.clonedeep";
|
|||
|
||||
import {EdgeAddress, Graph, NodeAddress, edgeToString} from "../../core/graph";
|
||||
import {createGraph} from "./createGraph";
|
||||
import * as exampleRepo from "./demoData/exampleRepo";
|
||||
import * as exampleRepo from "./example/exampleRepo";
|
||||
import {GraphView} from "./graphView";
|
||||
import type {Repository} from "./types";
|
||||
|
||||
import * as GE from "./edges";
|
||||
import * as GN from "./nodes";
|
||||
|
||||
const makeData = (): Repository => cloneDeep(require("./demoData/example-git"));
|
||||
const makeData = (): Repository => cloneDeep(require("./example/example-git"));
|
||||
const makeGraph = () => createGraph(makeData());
|
||||
const makeView = () => new GraphView(makeGraph());
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import tmp from "tmp";
|
||||
|
||||
import {createExampleRepo} from "./demoData/exampleRepo";
|
||||
import {createExampleRepo} from "./example/exampleRepo";
|
||||
import {loadRepository} from "./loadRepository";
|
||||
|
||||
const cleanups: (() => void)[] = [];
|
||||
|
@ -25,7 +25,7 @@ describe("loadRepository", () => {
|
|||
// src/plugins/git/loadRepositoryTest.sh --updateSnapshot
|
||||
// to update the snapshot, then inspect the resulting changes.
|
||||
expect(loadRepository(repository.path, "HEAD")).toEqual(
|
||||
require("./demoData/example-git.json")
|
||||
require("./example/example-git.json")
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
set -eu
|
||||
|
||||
data_file=src/v3/plugins/git/demoData/example-git.json
|
||||
data_file=src/v3/plugins/git/example/example-git.json
|
||||
|
||||
usage() {
|
||||
printf 'usage: %s [-u|--updateSnapshot] [--help]\n' "$0"
|
||||
|
|
|
@ -8,7 +8,7 @@ import cloneDeep from "lodash.clonedeep";
|
|||
|
||||
function exampleGraph() {
|
||||
const data: GithubResponseJSON = cloneDeep(
|
||||
require("./demoData/example-github")
|
||||
require("./example/example-github")
|
||||
);
|
||||
const view = new RelationalView(data);
|
||||
return createGraph(view);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
set -eu
|
||||
|
||||
data_file=src/v3/plugins/github/demoData/example-github.json
|
||||
data_file=src/v3/plugins/github/example/example-github.json
|
||||
|
||||
usage() {
|
||||
printf 'usage: %s [-u|--updateSnapshot] [--[no-]build] [--help]\n' "$0"
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {GithubResponseJSON} from "./graphql";
|
|||
|
||||
function exampleView() {
|
||||
const data: GithubResponseJSON = cloneDeep(
|
||||
require("./demoData/example-github")
|
||||
require("./example/example-github")
|
||||
);
|
||||
const view = new RelationalView(data);
|
||||
const graph = createGraph(view);
|
||||
|
|
|
@ -4,7 +4,7 @@ import * as R from "./relationalView";
|
|||
import * as N from "./nodes";
|
||||
|
||||
describe("plugins/github/relationalView", () => {
|
||||
const data = require("./demoData/example-github");
|
||||
const data = require("./example/example-github");
|
||||
// Sharing this state is OK because it's just a view - no mutation allowed!
|
||||
const view = new R.RelationalView(data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue