-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Juliiiian/master
Moved and fixed examples
- Loading branch information
Showing
16 changed files
with
331 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
node_modules | ||
/dist | ||
/public/*.map | ||
/test/test-write.map | ||
/test/examples/test-maps/* | ||
|
||
|
||
# local env files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"extension": [ | ||
"js" | ||
], | ||
"spec": "test/**/*.spec.js" | ||
} | ||
"extension": ["js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
{ | ||
"name": "rustworld", | ||
"version": "1.0.3", | ||
"type": "module", | ||
"license": "BSD-2-Clause", | ||
"exports": "./src/index.js", | ||
"main": "./src/index.js", | ||
"files": [ | ||
"/src" | ||
], | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"directories": { | ||
"lib": "./src", | ||
"test": "./test" | ||
}, | ||
"dependencies": { | ||
"protobufjs": "^7.1.1", | ||
"web-worker": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^10.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Dezinater/RustWorldJS.git" | ||
} | ||
"name": "rustworld", | ||
"version": "1.0.3", | ||
"type": "module", | ||
"license": "BSD-2-Clause", | ||
"exports": "./src/index.js", | ||
"main": "./src/index.js", | ||
"files": [ | ||
"/src" | ||
], | ||
"scripts": { | ||
"test": "mocha test/LoadMap.spec.js test/WriteMap.spec.js test/Examples.spec.js", | ||
"test-RandW": "mocha test/LoadMap.spec.js test/WriteMap.spec.js", | ||
"test-Examples": "mocha test/Examples.spec.js" | ||
}, | ||
"directories": { | ||
"lib": "./src", | ||
"test": "./test" | ||
}, | ||
"dependencies": { | ||
"protobufjs": "^7.1.1", | ||
"web-worker": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^10.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Dezinater/RustWorldJS.git" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import assert from 'assert'; | ||
import * as fs from 'fs/promises'; | ||
import generateCirclePlots from './examples/generate-circle-plots.js'; | ||
import generateIceWalls from './examples/ice-walls.js'; | ||
import getTerrainInfo from './examples/get-terrainmap-info.js'; | ||
import getMapSize from './examples/get-map-size.js'; | ||
|
||
describe('Examples', function () { | ||
this.timeout(120000); | ||
|
||
before(async function () { | ||
try { | ||
await fs.access('./test/examples/test-maps'); | ||
} catch (error) { | ||
await fs.mkdir('./test/examples/test-maps'); | ||
} | ||
}); | ||
|
||
it('Get terrain info', async function () { | ||
assert.equal(await getTerrainInfo(), true); | ||
}); | ||
|
||
it('Get map size', async function () { | ||
assert.equal(await getMapSize(), true); | ||
}); | ||
|
||
it('Generating circle plots', async function () { | ||
assert.equal(await generateCirclePlots(), true); | ||
}); | ||
|
||
it('Generating ice walls', async function () { | ||
assert.equal(await generateIceWalls(), true); | ||
}); | ||
}); |
Oops, something went wrong.