You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JS Compute Runtime doesn't currently contain automated tests itself. Instead, Fastly runs an automated test suite for an internal repository for the JavaScript SDK using the runtime.
88
-
89
-
Manual testing is well supported, however. To test your changes, you can follow these steps:
90
-
1. Build the runtime's CLI tool, see above
91
-
2. Create a C@E service from a JS source file by running the CLI tool
92
-
3. Test the service using [Fastly's local testing server](https://developer.fastly.com/learning/compute/testing/#running-a-local-testing-server)
74
+
The JS Compute Runtime has automated tests which run on all pull-requests. The test applications are located within <./integration-tests/js-compute>.
93
75
94
-
As an example, to turn a file `test.js` with this source code:
95
-
```js
96
-
addEventListener('fetch', e=> {
97
-
console.log("Hello World!");
98
-
});
99
-
```
100
-
101
-
into a C@E service with your build of the CLI tool, run the following command:
102
-
```sh
103
-
cargo run --release -- test.js test.wasm
104
-
```
105
-
106
-
Then test your service in Viceroy:
107
-
```sh
108
-
viceroy test.wasm
109
-
```
76
+
To run an end-to-end test which builds and deploys an application to c-at-e:
77
+
- Build the runtime and cli: `npm run build` in the root of the project
78
+
- Change to the test directory for the runtime: `cd integration-tests/js-compute/`
79
+
- Install the test depenendencies: `npm install`
80
+
- Get a list of all the applications to test: `node test.js`
81
+
- Test a single application via: `node test.js <name>` or test all via `node test.js --all`
110
82
111
83
## Testing a Dev Release
112
84
:warning:**You should not use this for production workloads!!!!!!!!**
0 commit comments