Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ bundle install
pnpm install
```

```
pnpm migrate
```

## Making sure your changes pass all tests

There are a number of automated checks which run on GitHub Actions when a pull request is created.
Expand All @@ -24,11 +28,13 @@ pnpm lint
```

### 2. Check the code for Ruby style violations

```
bin/rubocop
```

### 3. Run the test suite

```
bin/rspec
```
8 changes: 8 additions & 0 deletions spec/types_from_serializers/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ def generate_serializers
expect(ts_type).to eq(:string)
end

it "maps uuid type from SQL to string type in TypeScript" do
db_type = :uuid

ts_type = TypesFromSerializers.config.sql_to_typescript_type_mapping[db_type]

expect(ts_type).to eq(:string)
end

it "maps json type from SQL to object type in TypeScript" do
db_type = :json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ def default_config(root)
string: :string,
text: :string,
citext: :string,
uuid: :string,
json: "Record<string, any>",
jsonb: "Record<string, any>",
}.tap do |types|
Expand Down
Loading