Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert.equal(
data[2].local.idl['meta.json'].version,
now + 1000,
'Correct meta.json version'
);
assert.equal(
data[2].local.idl['meta.json'].remotes['github.com/org/a'].time,
(new Date(now + 1000)).toISOString(),
'Correct version of A'
);
// Fetch B locally
assert.equal(
data[3].local.idl['github.com'].org.b['service.thrift'],
thriftIdl('B'),
'Correct thrift B file locally'
);
assert.equal(
data[3].local.idl['meta.json'].version,
now + 2000,
'Correct meta.json version'
);
assert.equal(
data[3].local.idl['meta.json'].remotes['github.com/org/b'].time,
(new Date(now + 2000)).toISOString(),
'Correct version of B'
);
assert.equal(
data[1].upstream.files['idl/github.com/org/b/service.thrift'],
thriftIdl('B'),
'Correct thrift B file'
);
assert.equal(
data[1].upstream.meta.version,
now + 2000,
'Correct version'
);
// Fetch A locally
assert.equal(
data[2].local.idl['github.com'].org.a['service.thrift'],
thriftIdl('A'),
'Correct thrift A file locally'
);
assert.equal(
data[2].local.idl['meta.json'].version,
now + 1000,
'Correct meta.json version'
);
assert.equal(
data[2].local.idl['meta.json'].remotes['github.com/org/a'].time,
(new Date(now + 1000)).toISOString(),
'Correct version of A'
);
function onResults(err, results) {
if (err) {
assert.ifError(err);
}
var localApp = results[1].localApp;
var upstream = results[1].upstream;
var installedThriftFile =
localApp.thrift['github.com'].org.b['service.thrift'];
var installedMetaFile =
JSON.parse(localApp.thrift['github.com'].org.b['meta.json']);
// var localAppMetaFile = JSON.parse(localApp.thrift['meta.json']);
assert.equal(
installedThriftFile,
upstream.files['thrift/github.com/org/b/service.thrift'],
'Correct thrift file installed'
);
assert.deepEqual(
installedMetaFile.shasums,
upstream.meta.remotes['github.com/org/b'].shasums,
'Correct files and shasums for installed module'
);
assert.end();
function onResults(err, results) {
if (err) {
assert.ifError(err);
}
assert.equal(
results.local.idl['github.com'].barteam.joe['joe.thrift'],
results.upstream.files['idl/github.com/barteam/joe/joe.thrift'],
'Fetched the requested IDL file for barteam/joe'
);
assert.equal(
results.local.idl['github.com'].footeam.stooges['nyuck.thrift'],
results.upstream.files['idl/github.com/footeam/stooges/nyuck.thrift'],
'Fetched the dependency for joe.thrift'
);
assert.equal(
results.local.idl['meta.json'].time,
results.upstream.meta.remotes['github.com/barteam/joe'].time
);
tk.reset();
function onResults(err, results) {
if (err) {
assert.ifError(err);
}
assert.equal(
results.local.idl['github.com'].barteam.joe['joe.thrift'],
results.upstream.files['idl/github.com/barteam/joe/joe.thrift'],
'Fetched the requested IDL file for barteam/joe'
);
assert.equal(
results.local.idl['github.com'].footeam.stooges['nyuck.thrift'],
results.upstream.files['idl/github.com/footeam/stooges/nyuck.thrift'],
'Fetched the dependency for joe.thrift'
);
assert.equal(
results.local.idl['meta.json'].time,
results.upstream.meta.remotes['github.com/barteam/joe'].time
);
tk.reset();
var local = results[1];
var expected = [
'typedef string UUID',
'typedef i64 Timestamp',
'',
'service Idl {',
' UUID echo(',
' 1: UUID uuid',
' )',
'}',
''
].join('\n');
assert.equal(
local.idl['github.com'].uber.idl['idl.thrift'],
expected,
'Correct IDL file contents at the correct path'
);
assert.end();
}
});
function deletedRemote(cluster, remoteName, time, inspectLocal) {
var fixtures = {
idl: {
'github.com': {
'org': {}
}
}
};
fixtures.idl['github.com'].org[remoteName.toLowerCase()] = {};
return function update(callback) {
tk.freeze(new Date(time));
cluster.updateRemote(
remoteName,
fixtures,
inspectBoth(cluster, inspectLocal, callback)
);
};
}
import hashHistory from 'react-router/lib/hashHistory';
import './App.css';
import Config from './Config';
import DepGraph from './DepGraph';
import GetDummyHostNodes, { CanonicalDummyHostKey } from './DummyHost';
import GetGitHubNodes, { CanonicalGitHubKey, SetGitHubAuth } from './GitHub';
import GetNodes, { Canonicalizers, Getters, CanonicalKey } from './GetNodes';
import Home from './Home';
import Layout, { HeaderHeight } from './Layout';
import ShallowEqual from './ShallowEqual';
Canonicalizers['dummy'] = CanonicalDummyHostKey;
var dummyGetter = new GetDummyHostNodes();
Getters['dummy'] = dummyGetter.GetNodes.bind(dummyGetter);
Canonicalizers['github.com'] = CanonicalGitHubKey;
Getters['github.com'] = GetGitHubNodes;
function getSize() {
return {
height: window.innerHeight - HeaderHeight,
width: window.innerWidth,
}
}
export class HomeView extends Component {
render() {
return
}
}
export class DepGraphView extends Component {
w["git."]="470*2";
w["git:"]="100*2,110*2,113*4,114*2,150*2,287*2,301*2,355*2";
w["gitbranch"]="114*2,495*5";
w["gitbranchtask"]="221*46,446*1";
w["gitcheckout"]="301*3";
w["gitcheckouttask"]="69*46,446*1";
w["gitclon"]="100*1,110*1,113*2,114*1,150*1,287*1,301*1,355*1";
w["gitclonetask"]="166*46,446*1";
w["gitcommit"]="364*1";
w["gitcommittask"]="186*46,446*1";
w["gitfetch"]="466*2";
w["gitfetchtask"]="295*46,446*1";
w["gitgc"]="110*1";
w["gitgctask"]="204*46,446*1";
w["github"]="100*1,110*1,113*2,114*1,150*1,287*1,301*1,320*1,355*1,470*4,499*1";
w["github.com"]="100*2,110*2,113*4,114*2,150*2,287*2,301*2,355*2,470*2,499*2";
w["gitinit"]="466*1,488*2,495*1";
w["gitinittask"]="413*46,446*1";
w["gitlog"]="287*1";
w["gitlogtask"]="107*46,446*1";
w["gitmerg"]="114*1";
w["gitmergetask"]="446*1,484*46";
w["gitori"]="259*1";
w["gitorious.org"]="259*2";
w["gitpath"]="69*1,97*1,107*1,133*1,159*1,166*1,186*1,204*1,221*1,295*1,413*1,484*1";
w["gitpul"]="100*2";
w["gitpulltask"]="159*46,446*1";
w["gitpush"]="150*3";
w["gitpushtask"]="133*46,446*1";
w["gittag"]="355*5";
w["gittagtask"]="97*46,446*1";
w["give"]="38*1,42*6,81*1,154*1,158*1,255*1,277*1,328*1,344*1,354*1,382*1,384*1,402*6";
import './App.css';
import Config from './Config';
import DepGraph from './DepGraph';
import GetDummyHostNodes, { CanonicalDummyHostKey } from './DummyHost';
import GetGitHubNodes, { CanonicalGitHubKey, SetGitHubAuth } from './GitHub';
import GetNodes, { Canonicalizers, Getters, CanonicalKey } from './GetNodes';
import Home from './Home';
import Layout, { HeaderHeight } from './Layout';
import ShallowEqual from './ShallowEqual';
Canonicalizers['dummy'] = CanonicalDummyHostKey;
var dummyGetter = new GetDummyHostNodes();
Getters['dummy'] = dummyGetter.GetNodes.bind(dummyGetter);
Canonicalizers['github.com'] = CanonicalGitHubKey;
Getters['github.com'] = GetGitHubNodes;
function getSize() {
return {
height: window.innerHeight - HeaderHeight,
width: window.innerWidth,
}
}
export class HomeView extends Component {
render() {
return
}
}
export class DepGraphView extends Component {
expanded() {