Comments (1)
Below is based on my own understanding, take with a grain of salt.
Anything found in *.d.ts is just a declaration to help your IDE and TypeScript figure out if the code is wrong. None of these types are available at runtime.
With Screeps, where the majority of implementations are provided at runtime, testing is tough-er than usual - you need to mock everything. There are good starting projects, though.
https://github.com/eduter/screeps-typescript-jest-starter
https://github.com/eduter/screeps-jest
Take a look at https://github.com/eduter/screeps-jest/blob/master/src/setupGlobals.ts#L1601
Specifically, everything added to global
before the start of the test will be available at test runtime.
Closing this issue
from screeps-typescript-declarations.
Related Issues (20)
- RoomPosition.inRangeTo parameter type is too narrow HOT 3
- Issues with RoomVisual HOT 2
- assigning literal values to constants HOT 7
- Room.createFlag and RoomPosition.createFlag return type is number, when it can also be a string of the Flag's name
- RoomVisual constructor
- STRUCTURE_WALL should be 'constructedWall', not 'wall'
- Interfaces instead of declared classes HOT 4
- StructureSpawn.spawnCreep; deprecation of createCreep / canCreateCreep HOT 1
- typings are deprecated HOT 1
- Source should be class? HOT 1
- Missing Nuke class
- StructureSpawn should be a class HOT 1
- Room.createFlag definition HOT 1
- Allow typing of default memory objects HOT 5
- Object for defining globals HOT 2
- nuker added to CONSTRUCTION_COST constant.ts
- Typescript 2 is stable HOT 3
- Creep body part typings suggestion
- creep.room can literally never be undefined but types say it can be HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screeps-typescript-declarations.